CS 141 Programming Assignment 1 (First Real Assignment)

Fun Quiz


Overview

Your first real programming assignment in CS 141 will see how much you can accomplish with just input/output, variables and ifs. One fun thing to write a program that asks at least 20 questions of the user and then makes some type of conclusions based on the answers. Choose something that you think is fun! There are lots of possibilities - your 20 questions could be a trivia quiz, a personality rating test, a job pre-screening questionaire, a build your own adventure, suggest a sport/pet/career,etc. Think of it as a chance to entertain yourself, entertain others, interview fellow students, find new friends,etc.

The program should ask the user a series of questions (cout), read in their answers (cin), store them in appropriate variables based on the type of answer expected and then use if statements and/or arithmetic expressions to respond to the user and process all their answers into a conclusion. You should give the user plenty of feedback about their answers (right/wrong, what happens next, how their "score" was computed, what happened at the end, etc.).

I recommend avoiding free form questions like "How would you characterize your relationship with your parents?" because you will have to recognize/process their answers. That can get complicated. Instead, ask questions that have a well-defined range of possible answers (Yes/No questions with a prompt for y/n, questions with numerical answers, a menu of possible answers a-e, etc.)

If you ask for a string (e.g. "What is your name?"), keep in mind that reading in multiple word answers (e.g. "Jane Doe") will take a little extra work.

You should give the user helpful error messages when they enter invalid answers. Asking them again until they get it right is not required, but would be a nice addition.

You also need to give them a summary of your conclusions about their answers. For example, it could be information on their score and what that score means.

Part of this assignment is to have as many people as possible run your program and give you feedback. Did you give good error messages? Did they understand what to do? Did you give an understandable summary/feedback on all their answers? I will be providing you with a sheet you can use to have people sign when they've tried your program. There will be a prize for whoever has the most people try their program. You must have at least 5 other people in CS141 try your program. Feel free to modify your program as you go based on people's feedback.

Remember to start early!! Little logistical problems solved with a quick question or an email, turn into major crisis the night before the due date when no one is available to help. Also if you don't start early, you won't have time for testing with lots of users. Determine which office hours fit your schedule and plan to start the assignment before those!!! Then come in for help if you need it.


What to Turn In

You should turn in the assignment to the directory /afs/cu/class/cs141/students/YOUR_USERNAME/prog1 on polaris. There should be two files:

  • A prog1.cpp file with the source code of your working program. The program must compile and run on polaris. Remember to choose good variable names, use consistent, clear indentation and add good comments to explain your code.
  • A transcript of the program being run (transcript.txt).
  • In hardcopy, you will also turn in copies of the sheets that your users signed when they tried your program.