Assignment 0. Welcome to CS106B!


Due Friday, September 30 at 11:59 pm Pacific

  • Assignment 0 is a short exercise that introduces you to the tools and policies for this course. The due date is Friday to get you ready to jump on the first programming assignment when it is released.
  • The grace period on Assignment 0 allows late work up to 48 hours after the deadline. Read more about our course policy for accepting late work.

Welcome to CS106B! In this assignment, you will first install the Qt tools and CS106-specific package and then work through compiling, running, and debugging a sample program. This confirms you and your development environment are ready for the awesome adventures to come this quarter!

Step 1) Install Qt Creator

You must first install Qt Creator, the development environment that we use in CS106B. Follow the step-by-step instructions in our Qt Installation Guide.

⚠️ If you run into a snag when installing Qt, reach out to us for help! We will hold a Qt Creator install help session 7–9pm Thursday, September 29 in Durand 353. You can also post your install questions on the Ed forum or bring them to office hours.

Step 2) Download starter project

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

Download the archive and extract all. The starter project consists of two files: NameHash.pro (the Qt project file) and one C++ source file NameHash.cpp. Open the 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 be the same as anyone else's. Write your hash code down; you'll need it to complete the assignment!

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. At some point, you'll be asked to remember a special value. Write this special value down; you'll need it when you submit.

Step 5) Read course policies (Syllabus and 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!