Random number generator guessing game, computer programming, Programming Languages

The GuessingGame class contains a skeleton for a program to play a guessing game with the user. The program should randomly generate an integer between 1 and 10 and then ask the user to try to guess the number. If the user guesses incorrectly, the program should ask the user to try again until the guess is correct. When the guess is correct, the program should print a congratulatory message.
1. Download the Lab13 from Blackboard and work with the GuessingGame class.
2. Using the comments as a guide, complete the play() method so that it plays the game as described above.
3. Modify the program so that if the guess is wrong, the program says whether it is too high or too low. You will need an if statement (inside your loop) to do this.
4. Now add code to count how many guesses it takes the user to get the number, and print this number at the end with the congratulatory message.
Posted Date: 3/13/2012 6:00:00 PM | Location : United States







Related Discussions:- Random number generator guessing game, computer programming, Assignment Help, Ask Question on Random number generator guessing game, computer programming, Get Answer, Expert's Help, Random number generator guessing game, computer programming Discussions

Write discussion on Random number generator guessing game, computer programming
Your posts are moderated
Related Questions
write a procedure to add toolbar in VB application adding icons to toolbar buttons & with the approprite example display the use of each button

Often, DNA sequences are represented as a sequence of characters (String) and each character in the sequence corresponds with one of four nucleotides. A = adenine, C = cytosine,

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

1. Introduction The Tube Challenge is a Guinness World Records challenge that tests both the physical and mental abilities of the person trying to break it. The main components

The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of t

i(t)=(V/R) * (1-e^-(R/L)(t)) (a) Defi ne an anonymous function answerE that returns i(t) given input t. (b) The fi nal value for the current is 2 amps. Find a time tm when the curr

ASP.NET and ASP.NET AJAX ASP.NET AJAX, formerly known as "Atlas", is an Enthusiasm rendering of an AJAX centered structure, designed for ASP.NET (although it can be used on other s

1. A readme.txt file with: a. Instructions on how to compile and run your client and server code on the command line. (Also provide shell scripts if the commands are complicated

A manager at the local Walmart needs to determine how many workers to hire to cover a 24-hour period. Each worker must work 9 consecutive hours but may only start work at the begin

The Maze Game from Laboratory 7 loads its maze directly in the program's code. This should be avoided as it requires the program to be recreated if the maze needs to be changed. In