Create a program that will randomly pick an integer less than 100 (do NOT tell the user
Fantastic news! We've Found the answer you've been seeking!
Question:
int number = r.nextInt(100); //number is now a random int less than 100
Give the user 10 guesses to see if they can pick the right number.
FOR MAX 2 MARKS you should
- Ask the user a maximum of 10 times.
- If they guess the correct number, output "You win"
- If they run out of chances, output "Hard luck!".
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: