Question: Write a program in C that * asks the user to enter a single character * if the character entered is an upper case letter


Write a program in C that * asks the user to enter a single character * if the character entered is an upper case letter E, the program asks the user to enter an amount of money in the Euro currency. The user must enter the number of 50 bills, 20 bills, 10 bills, 5 bills. 2 coins. 1 coins, 50 cents coins. 20 cents coins, 10 cents coins, 5 cents coins, 2 cents coins and 1 cent coins. The program then computes the corresponding amount of US dollars and displays that amount as numbers of $20 bills, $10 bills, $5 bills, $1 bills, quarters, dimes, nickels and pennies. * otherwise, if the user enters any other letter than E, the program asks the user to enter an amount of money in the US dollar currency. The user must enter the number of $20 bills, $10 bills, $5 bills, $1 bills, quarters, dimes, nickels and pennies. The program then computes the corresponding amount of Euros and displays that amount as numbers of 50 bills, 20 bills, 10 bills, 5 bills, 2 coins, 1 coins, 50 cents coins, 20 cents coins, 10 cents coins, 5 cents coins, 2 cents coins and 1 cent coins. The program must display the correct singular and plural forms of the word 'bill' and 'coin', i.e. it must display e.g. 2 $20 bills' vs. e.g. '1 10 bili' (no s). The singular form is displayed for the number 1; the plural is displayed for the numbers 0, 2, 3, 4, 5.... See the input/output examples below for the precise formatting of the output. Whatever the conversion direction, the dollar bills and coins are always displayed first. As of today, 100000.00=$ 121199.00. DO NOT USE FLOATING-POINT VARIABLES. USE INTEGER VARIABLES ONLY. It is fine if there is some round-off due to integer division. THIS PROGRAM IS LONG! USE THE INCREMENTAL DEVELOPMENT APPROACH! Examples of input and output: Please choose the conversion direction: E for Euro->US Dollar, any other letter US Dollar->Euro: E Please enter the number of Euro 50 bills: 1 Please enter the number of Euro 20 bills: 1 Please enter the number of Euro 10 bills: 2 Please enter the number of Euro 5 bills: 17 Please enter the number of Euro 2 coins: 2 Please enter the number of Euro 1 coins: 8 Please enter the number of Euro 50 cents coins: 9 Please enter the number of Euro 20 cents coins: 2 Please enter the number of Euro 10 cents coins: 3 Please enter the number of Euro 5 cents coins: 5 Please enter the number of Euro 2 cents coins: 2 Please enter the number of Euro 1 cent coins: 1 11 $20 bills, 1 $10 bill, O $5 bills, 3 $1 bills, 1 quarter, 0 dimes, 1 nickel and O pennies correspond to 1 50 bill, 1 20 bili, 2 10 bills, 17 5 bills, 2 2 coins, 8 1 coins, 9 50cts coins, 2 20cts coins, 3 10cts coins, 5 5cts coins, 22cts coins and 1 1ct coin
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
