In this assignment, you will learn to program with conditional statements and loops by working problem 3.11 on page 202 of your text. Your program should be named HiLo (i.e., the class name should be HiLo) and it should play the HI-LO guessing game as described in problem 3.11 with the following additional requirements:
This program is not long but it does take some thought. Make a plan before you start typing. Perhaps the best approach is to outline what you need to do in pseudo-code; here's a start:
prompt and read desire to play prompt and read max number generate a random number in proper range prompt and read guess output message regarding success of guess if the user won, output the summary messages and repeat from step 1 above if the user did not win, repeat from step 4 aboveBefore typing, further details such as those regarding conditional statements and looping statements should be worked out.
Although plans should be formulated from the top down, programs should be implement from the bottom up. For example, start by implementing and testing the code to generate a random number in a specified range. Next, add handling of the user's guess; then complete the code to play one game. Finally, modify the program to play multiple games, if the user desires.
Bottom up implementation allows you to test your program as you go so that you always know what part of your code works and you don't duplicate mistakes.
Good Luck.
Note that 10% of your program grade is based on the readability of your program. This includes things like proper indentation, comments, and the naming of variables and methods as described in the style guide for this class. To receive full credit for your program, make sure that you use proper indentation as demonstrated in your text and in class room examples. Also include comments at the top of each program stating your name, the course, and the purpose of the program: For example:
/* ** Name: your name here ** ** Course: CSCI 201 ** ** Purpose: purpose of program here */
The program written for this assignment must be turned in by placing it in your csci/201 directory. The program must have the name HiLo.java and it must be located in the directory csci/201/HiLo. The program will be automatically copied from this location on March 3rd at mid-night.