Question: Java Programming Assignment. Need Help. Instructions for assignment are below. The name of your program/driver class should be WritingChecks.java WritingChecks.java will be your driver class.

Java Programming Assignment. Need Help. Instructions for assignment are below.

The name of your program/driver class should be WritingChecks.java

WritingChecks.java will be your driver class. This class will prompt the user to enter the check amount which should be a number between 0 and 99,999. WritingChecks will continue to loop until the user decides to stop. The Number.java class will be called to create an object of class Number. WritingChecks will create an array of Number objects created by the user. Once the user decides to stop the program, the Array of Numbers should be printed in reverse order.

Example: The user enters 397.899 and 2015.1

Your code should print:

two thousand fifteen 10/100

three hundred ninety seven 90/100

Number.java will have a constructor, two set methods, two get methods, a toString method and an equals method. The instance variables for Number.java. Some of these methods will not be used but they still need to be programmed. Failure to do so will result in points being deducted.

Instance Variables

double amount -User provides the amount

String spelling -String will be built within the class, not provided by the user

Set methods:

setAmount and setSpelling. The setSpelling method is the one that will spell the number. The setSpelling method may call any other number of methods to get the task done. This is also the method that will throw an exception if the number is not in range.

Other Methods in the Number.java class:

In order to efficiently spell numbers, you will need to create several other methods. These methods will also be part of the Number class. Because these methods should not be accessed by any other class they should be declared as private.

NumberException.java

You will need an exception so that it may be thrown when the user enters a number that is not in range. If the user enters more than two decimals you should just round but do not throw an exception for this.

Other requirements:

Your program should work with any number from 0 to 99,999.

Make sure that your error messages are "user friendly", specific and that they explain why things happen. You should display error messages if the number is out of range or if the user input is not a number.

Double numbers should be truncated and only the integer part should be spelled

You should use switch statements. You should not use more than 5 switch statements. None of the switch statements should contain more than 20 cases.

If you use if/else statements, you should not use more than 10 of these.

You should use at least 3 methods, more is better, will make your life easier

Your program should compile and run in JGrasp.

Your program should be commented and coded according to the JAVA coding standard.

This time you are allowed to use magic numbers

You should prevent your program from crashing. The crashing will deduct 50% of your assignment grade. If your program fails otherwise you will get extra deductions accordingly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!