Question: Write a program that does the following: using strin and char int Prompts the user for a 1 2 - digit ( maximum ) double
Write a program that does the following: using strin and char int
Prompts the user for a digit maximum double precision number.
eg: etc.
Verifies that the input is valid:
o There are a maximum of digits excluding the sign and decimal point
o All input digits are numeric with the following possible exceptions:
Minus sign in the first position
Decimal point in the nd or rd position before the end digit.
Fractions of more than digit positions are truncated
Converts the number into a currency format using string manipulation. The format
for the two examples above: $$ and $
Please note:
o Commas are placed at digit intervals, counted from the position of the
decimal dot
o A $ is placed in front to the left of a positive amount
o A $ is placed after the minus sign of a negative amount
o shall be treated in the same manner as a positive number
Displays the number in the currency format
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
