Write a C++ program that converts dollar amounts from numeric form into its English equivalent, similar to what would be seen on a check.† Your program should produce output exactly like the example below.
One Hundred Forty Three Dollars and No Cents
Two Dollars and 35 Cents
No Dollars and 10 Cents
One Dollar and 1 Cent
One Hundred Twenty Three Million Four Hundred Fifty Six Thousand Seven Hundred Eighty Nine Dollars and 12 Cents
1. Input numbers will always be between 0 and 1 billion.† (use a double to represent this amount)
2. Stop asking for amounts when 0 is entered.†
3. Capitalize as shown in the above example.
4. Put the dollars in words but the cents in numbers (except for No Cents).
5. Round all cents to the nearest penny.
6. Make sure the singulars and plurals are correct (Cent vs. cents,† dollar vs. dollars).
7. Donít worry about text being too long for the screen- itís ok for a word to be split in half at the screen edge.
Checks.cpp should be submitted on easel.
The main purpose of this program is to get experience with functions.† You will be penalized greatly for redundant code and unclear code, so use functions when appropriate.
Start with this code:
An audible version conforming to the same rules listed above should be played.
Sound files can be copied from:† \\cs1\Classes\Comp170\Number Voices for Checks Program
using namespace std;
//for this to work you must add winmm.lib to†
//menu -> Project | Properties
//tree -> Configuration Properties | Linker | Input | Additional Dependencies
†††††† PlaySound( "Number Voices for Checks Program\\Lumberjack\\one.wav", NULL, SND_FILENAME | SND_SYNC );