An automated donation machine accepts donations via 10 or 20 bills to a maximum of $990. The machine needs to print a receipt with the donation amount in English, rather than numerically. Complete the following function which converts any number between 10 to 990 dollars to English. NOTE: You may define and use another function if necessary. NOTE: You should use arrays for this task. Use of switch statements or very long if/else if statements for printing is not allowed. However, using if/else if/else statements for the logic of your algorithm is permitted. NOTE: This function returns the result, and does not print it. Make sure the result is not lost when you return. Example function input and output (donation is 110): in C++
An automated donation machine accepts donations via 10 or 20 bills to a maximum of $990.
The machine needs to print a receipt with the donation amount in English, rather than numerically. Complete the following function which converts any number between 10 to 990 dollars to English.
NOTE: You may define and use another function if necessary.
NOTE: You should use arrays for this task. Use of switch statements or very long if/else if statements for printing is not allowed. However, using if/else if/else statements for the logic of your
NOTE: This function returns the result, and does not print it. Make sure the result is not lost when you return.
Example function input and output (donation is 110):
in C++
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 5 images