Welcome to CS106B!

Friday, June 28


Deadline: Friday, June 28 at 11:59 PM

For this assignment, you are to install Qt Creator and then work through compiling, running, and debugging a sample program. This confirms you and your computer are ready for the awesome adventures to come this quarter!

Step 1: Install Qt Creator

Install the Qt Creator development tools by following the step-by-step instructions in our Qt Installation Guide. Note that some of the recommended settings (like "save all files before build") are very important, so make sure to apply these settings after you've successfully installed Qt creator.

⚠️ If you run into a snag when installing Qt, we're here to help. The section leaders will hold a special help session for Qt installation 7 – 9 PM Thursday, June 27 in Durand 353. Bring your computer and we can diagnose the issue and resolve to get you on your way. You can also post install questions on the Ed forum.

Step 2: Download starter project

For each assignment, we create a starter project and post it as a ZIP archive. Here is the archive for this assignment:

Download the archive and extract all. Move the starter project folder into your CS106B folder. The starter project contains two files: NameHash.pro (Qt project file) and NameHash.cpp (C++ source file). Open the .pro project file in Qt Creator. The first time you open a new project, Qt Creator will ask you to configure it; select the default kit (Qt 6.x) from your Qt install.

Step 3: Hash your name

In the Qt Creator window, click the green triangle in the lower-left to build and run the program. When the program runs, the console window appears and will prompt you to enter your preferred first and last names. The program then computes a hash code from your name. The hash code is like a “fingerprint”, unique to your name and unlikely to match anyone else's. Write down the hash code for your name; you'll be asked for it when you submit.

While you are here, skim the code for a preview of C++ syntax and control flow. Don't worry if you don't fully understand the math behind the algorithm just yet, consider it a teaser for ideas we will explore together later in the quarter.

Step 4: Practice with debugger

Knowing your debugger is a key component in your programming tool belt. Our colleague Keith Schwarz wrote a wonderful tutorial to introduce students to the Qt debugger. The tutorial guides you through using the debugger to inspect the NameHash program.

Open the debugger tutorial and follow along step-by-step. Along the way there is a point where the tutorial asks you to remember a special value that you see in the debugger. Write down this special value; you'll be asked for it when you submit.

Step 5: Read course policies (Syllabus, Honor Code)

Please read the pages on the course website that detail our policies for the syllabus and Honor Code. We want to ensure that you know what to expect from us and what we will expect from you. If you have any questions or concerns about the course policies, make a post on Ed or via private email to clarify or resolve issues before choosing to enroll.

Step 6: Submit

Once you've finished everything, fill out this form while logged into your Stanford Google account:

Enter the numbers from Steps 3 and 4, confirm that you understand the course policies, and submit the form.

Congrats and welcome to CS106B!