Assign1: Getting Your C++ Legs
Due Friday, April 17 at 11:59 pm
- The assignment deadline is by the end of the day, Anywhere on Earth.
- Submit by end of day Friday deadline for a small, “early-bird” bonus.
- All students have a pre-approved extension or "grace period" that extends until Sunday end of day AoE, with no penalty.
- The grace period expires end of day Sunday, after which we cannot accept further late submissions.
- Note that our Paperless submission system displays due dates and submission times in PDT frame of reference.
Here it is – the first programming assignment of the quarter! This assignment is designed to get you up and running with the C++ language and the tools used in CS106B. The work involves a mix of coding, testing, and debugging tasks. By the end of this assignment, you'll have fully gotten your C++ legs under you! (our apologies for the bad pun…)
The code you will write involves expressions, control structures, functions, string processing, and files. You have prior experience with these concepts, but the tricky part is figuring how to map what you already know to the strange new world of C++. The transition is what this assignment is all about. In addition to giving you practice with C++ syntax and libraries, the assignment will guide you through the tools and approaches you can use to test and debug your code. By the time you've completed it, you'll be a lot more comfortable working in C++ and will be ready to start building larger projects!
This assignment is to be completed individually. Working in pairs/groups is not permitted.
Assignment parts
This assignment consists of two parts.
-
Perfect Numbers
is a fun warmup exercise involving number theory, algorithms, and optimization. It gives you a guided transition into C++, as well as the testing and debugging tools that we will be using in CS106B this quarter. You can get started on this one right away – and we recommend doing so! Aim to have this part of the assignment completed by Monday, April 13. That way, you'll have time to get cracking on the bigger second part.
-
Soundex Search
is a complete program that demonstrates a nifty algorithm for matching and grouping names based on their pronunciation. This program uses C++ strings, files, and the
Vectorclass. Make sure that you have watched the lecture content on strings (Friday and Monday) before starting this part of the assignment. This part requires you to write a more substantial chunk of code, and getting a jump on it means you will have time to work through issues and reach out for help (using the Ed forum, LaIR, and instructor office hours) if you hit any snags. We recommend starting this part of the assignment no later than Monday, April 13. Aim to have this part of the assignment completed by Friday, April 17.
Getting started
We provide a ZIP of the starter project. Download the zip, extract the files, and open the project in Qt creator.
The two source files you will edit are:
perfect.cppsoundex.cpp
Additionally, you will write short answers to some questions in short_answer.txt.
Helpful Resources
Here are some resources that you might find helpful for this assignment:
- A Guide to Testing Code in CS106B
- A couple of our section leaders have put together a wonderful guide to transitioning from Python to C++ that points out syntactical and functional differences between the two languages.
- Lecture slides: Wednesday Intro C++, Friday Strings
Getting Help
As always, feel free to reach out to us if you have questions. Feel free to contact us on Ed, to email your section leader, or to stop by the virtual LaIR (helper hours this quarter are Sunday-Thursday evenings, 5:00PM – 9:00PM PDT and Monday, Tuesday mornings, 9:00AM - 11:00AM PDT). You can find more information about how to get help at the LaIR here. As a reminder, try to visit the LaIR for coding debugging questions – however if you cannot make the LaIR due to time zone issues, you can post your code on Ed to get help. However, you must use a private post so that you are not posting your code for the whole class to see.
Submit
Before you call it done, run through our submission checklist to be sure all your t's are crossed and i's dotted. Then upload your completed files for grading to the Paperless website.
Please submit only the files you edited; for this assignment, these files will be
perfect.cppsoundex.cppshort_answer.txt
You don't need to submit any of the other files in the project folder.
Note: When submitting to Paperless, all due dates and submission times will be displayed in PDT across the website.
That's it, you're done! Congratulations on finishing your first CS106B assignment!