Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Due Monday by 6pm Points 7 Submitting a text entry box or a file upload Assignment 9: Exception Handling Create an Exception class called BadGuessException

image text in transcribed
Due Monday by 6pm Points 7 Submitting a text entry box or a file upload Assignment 9: Exception Handling Create an Exception class called BadGuessException BadGuessException should be a sub-class of the Exception class [1 point] Create 2 constructors [1 point] . A default constructor in the BadGuessException class, that passes the message-Sorry, that was an invalid guess!" to the parent constructor using keyword super. A parameterized constructor in the BadGuessException class that will pass the parameter to the parent constructor using keyword super Create a class called GuessingGame - Generate a random number between 1 and 10 - Prompt the user to guess the number. Allow the user unlimited attempts to guess the number correctly. [1 point) : Once the user guesses the number correctly, print out "YOU GOT IT: and print out how many tries it took the user to guess the number. I1 point) - Using a try catch block, add exception handling to your code. 12 points) throw a BadGuessException if the user enters any number that is not between 1 and 10 Add another catch block to catch the exception thrown if the user enters an incorrect format for number they suessed. such as "five" or "5.0". This should prevent your program from crashing or throwing a run time excpetion. When this exception is caught the program should not crash and should display Sorry you entered an invalid number format [1 point) Submission Due on Thursday. December Ai at 6:00 PM

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

What is proper form flow?

Answered: 1 week ago