Question: For each numerical value 0, 1, 2, ...9 (0

For each numerical value 0, 1, 2, ...9 (0 <= NUMBER <= 9), embedded in a sentence, convert that value to its equivalent English text. Print the converted sentence to the screen and to an output file. Your input file consists of a variable number of records. Each record is a sentence of length <= 80 characters. More than one numerical value in the given range may appear in a sentence. You must deal with upper and lower case issues. If a line begins with a single digit, write that digit as a word starting with an uppercase letter. See the examples below. Examples: Input Record: 3 foxes were chasing 5 rabbits and 10 ducks. Output Record: Three foxes were chasing five rabbits and 10 ducks. Input Record: I used 3 eggs out of the 12 for the cake. Output Record: I used three eggs out of the 12 for the cake. Input Record: 1 picture is worth 1000 words. Output Record: One picture is worth 1000 words. Input Record: There are 260 students enrolled in Java. Output Record: There are 260 students enrolled in Java.

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!