CSC 213 — Programming Fundamentals

Lab 06 - Number Guessing Game

Assignments

Create a number-guessing game that corresponds to this output:

Choose a number between 1 and 100:
50
Too high.
Choose a number between 1 and 50:
38
Too low.
Choose a number between 38 and 50:
46
Correct.
Game Over.

A few things to note:

import java.util.Random;
...
Random rand = new Random();
int upperBound = 100;
int randomNumber = rand.nextInt(upperBound + 1);

Restrictions:

Submission

To submit your assignment, follow the instructions for code submission.