Question: Revisit the Cycle class in Unit 3.10.1. Modify your application such that the properties, numberOfWheels and weight are entered as double values interactively (at the
Revisit the Cycle class in Unit 3.10.1. Modify your application such that the properties, numberOfWheels and weight are entered as double values interactively (at the keyboard). Exception handling will be used to determine whether a type mismatch occurs.
Edit your application such that, in addition to [A], the values for numberOfWheels and weight, entered interactively, will throw a new exception Values cannot be less than or equal to zero only If the values are less than or equal to zero. Add or use the appropriate try and/or catch blocks.
Directions
Examine your application for the class called Cycle.
Add Try and Catch blocks appropriately.
Add the throw statement for the new exception.
Display an appropriate message if an exception occurs.
Display the properties of the object.
Note: Verify the contents were written to the text file using notepad (or any word processor).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
