Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 11 Exercise2.java: SPRING 2018 CS-401 PROJECT# 11: EXTENDING THE EXCEPTION CLASS This assignment is a re-make of Lab#11s Exercise #2 This time when the

Project 11
image text in transcribed
image text in transcribed
Exercise2.java:
image text in transcribed
SPRING 2018 CS-401 PROJECT# 11: EXTENDING THE EXCEPTION CLASS This assignment is a re-make of Lab#11s Exercise #2 This time when the user enters an int that is Java legal but out of the 1..100 range, you will manually throw an Exception of type Exception. This type is not a built in Java Exception type. This is a type (a new class) that you will write by extending the built in Exception type. There are 3 possible Exceptions that the.nextInt method can throw o InputMismatchException-if the next token does not match the Integer regular expression, or is out of range o NoSuchElementException -if input is exhausted DONT WRITE A CATCH BLOCK FOR THIS o IllegalStateException if the scanner is closed DONT WRITE A CATCH BLOCK FOR THIS You do not have to code up catch blocks for the last two cases because the given code should not trigger these cases. Just let the general Exception case at the bottom of your stack catch these and any other unexpected errors. You should write the following blocks pronpt usez s Systen ange1.109 print the thank yu ge Below main you NumberOutOfRangeException that extends Exception. In this class you will overwrite the default constructor such that it prints Number out of range. Must be in 1..100 must write your new Expection class named The behavior and output of your Project 11 solution will be identical in appearance to your Exercise#2 solution from Lab#11 The difference be in how it is written. If a user were to run your Lab# 11 Exercise#2 solution and then run your Project #11 solution, they should not be able to detect any diffence in appearance or behavior reagardless of what inputs are fed to it by the user The difference of course is in how it is written: but by all Here is the starter file from Exercise2.java. You must rename it to: Project11.java and add a class definition (named Project #11 file. This new class will extend the general Exception class. Exception) to the bottom of the

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_2

Step: 3

blur-text-image_3

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

LO2 Explain the nature of the psychological contract.

Answered: 1 week ago

Question

LO1 Discuss four different views of motivation at work.

Answered: 1 week ago