c question A thirdgrade teacher at Plano Elementary School w
c++ question
A third-grade teacher at Plano Elementary School wants a program that allows a student to enter the amount of money a customer owes, then an amount of money the customer has paid. The program should calculate the amount of change, as well as how many dollars, quarters, dimes, nickels, and pennies to give back to the customer. Display an appropriate message if the amount paid is less than the amount owed.
a. create an IPO chart for the problem, and then desk-check the algorithm three times. For the first desk-check use 75.34 ans 80as the amount of owed and paid, respectively. For the second desk-check use 39.67 and 50. for the third desk-check use 10.55 and 9.75.
b. list the input, processing and output items, as well as the algorithm, in a chart. Then code the algorithm into a program.
c. desk-check the program using the same data used to desk-check the algorithm.
I have the answer of question d. Here it is. i need the answer of other 3 questions a,b,c. Please
#include
#define dollar 1.0
#define quarter 0.25
#define dime 0.1
#define nickel 0.05
#define penny 0.01
using namespace std;
int main()
{
double paidAmount;
double owedAmount;
double balance;
int countDollars = 0;
int countQuarters = 0;
int countDimes = 0;
int countNickels = 0;
int countPennies = 0;
// Get amount owed and amount paid
cout << \"enter owed amount:\";
cin >> owedAmount;
cout << \"enter paid amount:\";
cin >> paidAmount;
// Find the change to return in Dollar, Quarter, Dime, Nickels, Pennies
balance = paidAmount - owedAmount;
countDollars = balance / dollar;
balance = balance - (countDollars);
countQuarters = balance / quarter;
balance = balance - (countQuarters*quarter);
countDimes = balance / dime;
balance = balance - (countDimes*dime);
countNickels = balance / nickel;
balance = balance - (countNickels*nickel);
countPennies = balance / penny;
//Display the change to return
if (paidAmount >= owedAmount)
{
cout << \"The change to give is :\" << paidAmount - owedAmount << endl;
cout << \"Please give the change to the customer:\" << endl;
cout << countDollars << \"Dollars\" << endl;
cout << countQuarters << \"Quarters\" << endl;
cout << countDimes << \"Dimes\" << endl;
cout << countNickels << \"Nickels\" << endl;
cout << countPennies << \"Pennies\" << endl;
}
else
{
cout << \"still the customer has to pay\" << owedAmount - paidAmount << endl;
}
return 0;
}
Solution
HERE is the IPO chart for you:
Input
Processing
Output
Owed Amount
Paid Amount
Processing Items: none
Algorithm:
Count of dollars, quarters, dimes, nickels, and pennies
| Input | Processing | Output |
| Owed Amount | Processing Items: none
| Count of dollars, quarters, dimes, nickels, and pennies |

