Question: 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

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: Notestzero would onk be ysed whenthe value sexactlo? 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 Tatestyour program, create a WordedNumber object in main. Write a for loop that does the following: Loop from i=0 to 999 : Set the Worded Number object's value to i Outputi +":+ conversion to English word + 7nm For negative numbers, loop from 1 to 999. See the screenshats below for a better idea of how to test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
