Write a program that accepts an input amount in Euros (EUR) and displays the equivalent breakdown using the fewest number of $50, $20, $10, $5 bills, and $1 coins. For example:
Enter a EUR amount: 99
The input corresponds to
$50 bills: 1
$20 bills: 2
$10 bills: 0
$5 bills: 1
$1 coins: 4
More input-output samples.
Before submitting assignments, ensure that your program successfully handles the input-output examples provided above.
The input is assumed to be an integer with a size range from 1 to 1000.
The outputs of your program should be exactly the same as those in the input-output samples.
Every character in the output (spaces, newlines, punctuation, and letters) should be identical to the provided samples.
To ensure correct formatting, It is recommended that you modify the code template when completing this assignment.
Output formatting:
The following line is from the code template.
cout << "$50 bills: " << variable2 << endl;
The following is incorrect, because it removes a space from the string enclosed by double quotes.
cout << "$50 bills:" << variable2 << endl;
The following is incorrect, because it outputs extra line breaks caused by system("pause").
cout << "$50 bills: " << variable2 << endl; system("pause");
The following is incorrect, because it outputs extra endl.
cout << "$50 bills: " << variable2 << endl; cout << endl;
Suggestions:
Rename variable1 through variable6 with meaningful names.
For instance, you can rename variable1 to eur_amount or eurAmount.
Remove comments.
Typically, if your variable names are descriptive, there's no need to include comments.
Ensure that you use the integer type (not floating-point) throughout your code for this assignment.