CSCI 261 - Programming ConceptsSpring 2019 - A3 - Guess The NumberQuick Links: Canvas | Mines | Piazza | zyBooks |
|||||||||||||||||||
| Home | Contact | Syllabus | Assignments | Schedule | Resources | | |||||||||||||||||||
This assignment is due by Thursday, February 7, 2019, 11:59 PM. · Instructions · Rubric · Submission · This assignment exercises your ability to use loops, and provides more experience with asking the computer to generate a pseudo-random number. Instructions
Your goal for this assignment is to exercise your knowledge of
selection statements (
Hold onto your pants, we're about to play guess-the-numbah!
Enter the lowest possible number: 14 Enter the highest possible number: 15 High number must be at least 100 more than the low number. Enter the highest possible number: 132 Pick a number between 14 and 132: 20 Too low! Not even close! Pick a number between 14 and 132: 75 Too high! Pick a number between 14 and 132: 1 Invalid guess. Pick a number between 14 and 132: 63 Too low! Oooh you're close! Pick a number between 14 and 132: 64 That's right! You won the game in 4 tries. You must first prompt the user to enter the low end of the number range. Then prompt the user to enter the high end of the number range. The high end must be at least 100 more than the low end entered by the user. Your game must use a random number between LOW and HIGH, inclusively. You should only accept guesses that are within the range [LOW, HIGH], showing an error message otherwise. Your game must print "Too low!" or "Too high!" relative to the target number and the players' guess. Your game must print "Oooh you're close!" if the number guessed differs from the target by 5 or less; and it must print "Not even close!" if the number guessed differs from the target by a value of 25 or more. For example, if the target is 50 and the player enters 10, your program should print "Too low!" and "Not even close!", but if the player enters 52, your program should print "Too high!" and "Oooh you're close!". When the correct number is guessed, your program must print "You won the game in N tries" where N is the number of valid guesses the player made. Functional Requirements
Grading RubricYour submission will be graded according to the following rubric.
This assignment is due by Thursday, February 7, 2019, 11:59 PM. SubmissionAlways, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available. The following instructions are copied from How to Submit Homework. It is critical that you follow these steps when submitting homework.
If you do not follow these instructions, your assignment
will receive a major deduction. Why all the fuss? Because we have
several hundred of these assignments to grade, and we use
computer tools to automate as much of the process as possible.
If you deviate from these instructions, our grading tools will
not work. And that makes us very unhappy. And when we're
unhappy, we give penalties. Thus, make us happy.
Submission Instructions Here are step-by-step instructions for submitting your homework properly:
In summary, you must zip the
"Set3" folder
and only the "Set3" folder, this zip folder must have several sub-folders, you must name all these folders correctly, you must submit the correct zip file for this
homework, and you must click the "Submit Assignment" button. Not doing these steps is like bringing your
homework to class but forgetting to hand it in. No concessions will be made for
incorrectly submitted work. If you incorrectly submit your homework, we will not be able to
give you full credit. And that makes us unhappy. This assignment is due by Thursday, February 7, 2019, 11:59 PM. | |||||||||||||||||||
Last Updated: 01/22/19 20:56
|