Question: Write a program called P6_DollarToPound that prompts the user only once for todays conversion for one US dollar to British Pound Sterling. Then prompt the
Write a program called P6_DollarToPound that prompts the user only once for todays conversion for one US dollar to British Pound Sterling.
Then prompt the user for a US dollar value, which will then inform the user of the resultant British pounds. Continue a prompting loop for other US dollar values, until the sentinel value of zero (0) is encountered.
Hint: Your while loop should not include the prompt for the exchange rate. When the user enters a 0 for the US dollar amount, the program will print a terminating message and exit.
One-Time prompt: Enter todays US Dollar to British Pound Sterling exchange rate:
Looping prompt: Enter the US Dollar amount to convert to British Pounds or 0 to quit.
Output:
One time: Today, 1 US dollar will yield .xxxx British pounds.
100.00 US dollars will purchase 7707.70 British pounds.
Enter the US Dollar amount to convert to British Pounds or 0 to quit
When the user enters a 0, the program will print a terminating message such as Goodbye! and exit. Sample output: Enter today's US Dollar to Japanese yen exchange rate (yen per Dollar): 120 Enter US Dollar amount to convert to Japanese yen (type 0 to quit):500 Based on an exchange rate of 1 to 120.0,500.00 US Dollars will return 60000.00 Japanese yen. Enter US Dollar amount to convert to Japanese yen (type 0 to quit): 250 Based on an exchange rate of 1 to 120.0,250.00 US Dollars will return 30000.00 Japanese yen. Enter US Dollar amount to convert to Japanese yen (type 0 to quit): 125 Based on an exchange rate of 1 to 120.0,125.00 US Dollars will return 15000.00 Japanese yen. Enter US Dollar amount to convert to Japanese yen (type 0 to quit): 0 Goodbye!
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
