Question: Please I need this assigment in C code (not c++). Preferable in editable (copy and paste) code. Write a program that inputs a dollar amount
Please I need this assigment in C code (not c++). Preferable in editable (copy and paste) code.
Write a program that inputs a dollar amount to be printed on a check and then prints the amount in check-protected format with leading asterisks if necessary. Assume that nine spaces are available for printing an amount.
(Explanation) Suppose a paycheck contains nine blank spaces in which the computer is supposed to print the amount of a weekly paycheck. If the amount is large, then all nine of those spaces will be filled, for example:
11,230.60 (check amount) --------- 123456789 (position numbers)
On the other hand, if the amount is less than $1000, then several of the spaces will ordinarily be left blankfor example,
99.87 --------- 123456789
contains four blank spaces. If a check is printed with blank spaces, its easier for someone to alter the amount of the check. To prevent such alteration, many check-writing systems insert leading asterisks to protect the amount as follows:
****99.87 --------- 123456789
Also, the program should also output the word equivalent of the amount. For example, the amount 52.43 should be written as
FIFTY TWO and 43/100
and the program should print out:
****52.43
FIFTY TWO AND 43/100.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
