top of page

Computer Programming 2 - SY2223 - 2T | 05 Exceptions Handling | Lab Exercise | Java Quiz Bee
 

Laboratory Exercise | Guessing Game

Instructions:
Create a Java Program;

The program shall:
generate a random number from 1 to 50 for a player to guess;
display a message that indicates whether the player's guess is correct, too low, or too high; and prompt the user to keep on guessing until the correct values is entered. Create a try-catch structure that will handle two (2) exceptions. These are when the user inputs the following: a number that is out of range (1-50) a letter or any non-numeric character
Prompt the user so that he can guess again if an exception is thrown.
Display the number of total guesses.


Note: An invalid input (when an exception is thrown) is not considered a valid guess or attempt.

 

Java Program Code: https://bit.ly/ComProg205HandsOnActivity2JavaQuizBee

Source Article: https://arcania21.wixsite.com/allaboutechnology/labexercsise5bjavaquizbee

ABOUT US

I'm a paragraph. Click here to add your own text and edit me. It’s easy. Just click “Edit Text” or double click me to add your own content and make changes to the font. Feel free to drag and drop me anywhere.

  • Grey Facebook Icon
  • Grey Twitter Icon
  • Grey YouTube Icon

© 2035 BY EZ ELECTRONICS. Powered and secured by Wix

NEW RELEASES

I'm a paragraph. Click here to add your own text and edit me. It’s easy. Just click “Edit Text” or double click me to add your own content and make changes to the font.

Thanks for submitting!

bottom of page