Question: Help please!! It requires a header function and the main function. Instructions In elementary school, you learned how to express a number in an English

Help please!! It requires a header function and the main function. Help please!! It requires a header function and the main function. InstructionsIn elementary school, you learned how to express a number in anEnglish word format. For example: the number 1 is spelled as "one",

Instructions In elementary school, you learned how to express a number in an English word format. For example: the number 1 is spelled as "one", 2 is "two", 3 is "three", and so on. In this program, we are going to create a new class called "WordedNumber" which has the capability to produce a string with the English word of the number it is storing. To make this simple, we will only support the numbers from -999 to 999. If a number is negative, then the number should have "negative" as a prefix. Example: "negative one," "negative two hundred twenty three," etc. Below is a chart of the words to use: Note: "zero" should only be used when the value is exactly 0. Do NOT spell 20 as "twenty zero", for example. Class Design Description of Methods - constructor - either accepts an initial number or defaults to zero. Additionally, rejects any number outside the supported range as described in the instructions. - getNumber - returns the numerical version of the number the object is storing. - setNumber - sets a new number to be stored. Additionally, rejects any number outside the supported range as described in the instructions. - toWord - generates the English word of the number being stored and returns it as a string. Testing To test your program, create a WordedNumber object in main. Write a for loop that does the following: Loop from i=0 to 999 : Set the WordedNumber object's value to i Output i + ": " + conversion to English Word + "In" For negative numbers, loop from 1 to 999. See the screenshots below for a better idea of how to test. Sample Outputs

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!