| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Assignment - Guessing Game

Page history last edited by Steve Sweeney 13 years, 5 months ago

 

There are several levels of difficulty to this assignment. To receive a perfect mark, all levels must be completed. Please complete all levels in order unless instructed otherwise.

Save your file as Lastname_Firstname_Guessing_Game and submit it to the appropriate folder.

 

This is an assignment - please work independently.  In general, you should feel free to discuss the overall assignment and concepts, but students should not be helping each other with programming actual code.  Students will be observed while working on the assignment and inappropriate interaction can affect your overall mark.  In addition, all programs are checked for plagiarism.

 

Up to Level 2 (up to 70%) - meets minimum expectations for functionality

 

Create a program that has the computer generate a random number between 1 and 100. The user is then asked to guess the number. If the user is wrong, they are informed whether the answer is too high or too low. The user is then allowed to guess again. This continues until the user guesses the number correctly.  You must also include an introduction screen with instructions. Please do not use sound or any pauses.

 

Marks will be awarded in the categories of Application and Communication.

Application - required features are present; features work properly

Communication - quality of the user interface (instructions, prompts, messages to the user, overall appearance and formatting); quality of source code (program header, comments, good variable names, proper indenting, breaking up sections of code with blank lines for readability)

 

Up to Level 3+ (up to 80%) - meets full expectations for this assignment

 

Change the program so that instead of the given range of numbers 1 to 100, the user can specify the range of number from which the computer must generate a random number. That is, at the very beginning of the program the user will be asked to input the minimum and maximum numbers of the range. The computer will then generate the random number in this new range.

 

Note/Warnings: 

  1. Before you try another level, make sure you have perfected the previous level.  It is better to do a great job at a lower level than a mediocre job with higher levels.  Your overall mark will probably be better with a very good effort at the lower level.
  2. Once you have a level working perfectly, save the file before you make modifications.  Some of the higher levels require extensive changes to the code, and you don't want to ruin code that was working (if you can't get the higher level working, you will have to hand in the lower level... better to have it ready to go!)

 

Up to Level 4 (up to 90%)

 

Add enhancements to the program that improve the overall quality.  Some examples are:

  1. Modify the program so that there is a limit on the number of guesses (for example: maximum of 10 guesses). If the user guesses the correct number before their attempts run out they win, otherwise the computer wins.  There are better and worse ways to do this, and your effort will be graded accordingly.
  2. Modify the program so that the computer keeps track of how long it takes the user to play the game and gives more points if the user is able to guess the number quickly.  This feature may require you to do additional research into the programming language.

 

Up to Level 4+ (up to 100%)

 

Add an option that allows the computer to play against itself.  This option also has various levels of sophistication.  For example,

  1. The computer plays against itself for a single game, showing guesses and progress.
  2. The computer plays against itself for a specified number of games, showing guesses and progress.
  3. If the number of self-plays is below a threshold, show the games.  Above a threshold, have the games play very quickly without showing the games - just report the end results.

 

Comments (0)

You don't have permission to comment on this page.