Programming Assignment 1: Classification system
Contents
Overview
For this programming assignment, you will create a program to aid the user in classifying an item. You should choose at least 10 items (whatever you want) to classify (e.g., different species of trees, sports, colleges, etc.) and devise a series of questions to help a user narrow down to a single item. You can use an existing classification scheme from a book or the web if you'd like.
Example
Here's an example of what interacting with a program for classifying my pets, past and present. The orange text is entered by the user.
./pa1 ================================================================================ Welcome to the Hank's pet identifier! ================================================================================ Picture one of Hank's pets and answer the questions to find his or her name. Is this pet a dog, cat, or bird? : dog Is this pet a male or female? : male Is this pet a beagle or bloodhound? : beagle You must be talking about Bobo!
Specifications
Your completed program will be evaluated based on your completion of the following specifications:
- (10pts) the code is well formatted (correct indentation)
- (10pts) the code has a header with the student's name, date, a description of the program, how many hours you spent on it, and lists who the student sought help from (see below)
- (10pts) comments are included to explain the code
- (10pts) the code is clean and efficient
- (20pts) the program compiles
- (20pts) the program runs smoothly: it doesn't crash, it is clear what information the program is asking for when prompting the user, and the behavior of the program is as expected based on the given inputs
- (20pts) at least 10 items are classified and makes sense together
- the program should be your own work (copying work from other sources, including classmates, is plagiarism)
Getting started
I recommend that you go through the planning steps we talked about. First, sketch out what you want your questions to be and what answers will lead to what other questions. A flowchart would be helpful.
Second, write out the pseudocode for your algorithm. Remember, pseudocode is English and is mainly a way for you to think about the steps involved in your program without worrying about syntax.
Third, start with the skeleton (pa1-console-starter.cpp) from the
course Zovy directory. You can rename this file whatever you'd like. This source
code file has comments starting with TODO
in places where you need
to add code. The main bit is inside of main. This is a good place to place your
pseudo code as comments. Some of your pseudocode may overlap with the code I've
already provided you, so read carefully.
Fourth, implement incrementally. Makes sure your program compiles before you implement anything. After successfully compiling, implement a one or two lines of your pseudocode, then recompile and run your program. If your program doesn't compile or run as expected (given what you've implemented), you know it's because of something you just implemented. Debug your program and once it compiles and runs as expected, implement the next line or two of your pseudocode.
When you think you are finished, be sure to test you program. Make sure you can reach all 10 of your items. Makes sure your program meets all of the specifications above.
When to seek help
Programming is a time intensive endeavor. Expect this to take anywhere from an hour to 10 hours and plan accordingly. If you reach a point where you are not sure how to proceed (you don't know how to implement something or you have a bug in your code), be sure to check the notes and readings first. Don't be afraid to try things out to see how they work. If you spend 30 minutes without making any progress, then send me an email or see a tutor.
Challenge
If you would like to try something more challenging, or at least different, you may create a graphical user interface (GUI) version of this project. I have starter code for a very simple GUI using the FLTK library. Please email me if you are interested in attempting this. You may receive 5 extra credit points if you complete the GUI version.
Submission
Upload your source code file to Canvas here. See the Canvas assignment for a grading rubric.
(Back to top)