Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a C++ project. There are 2 parts in this problem. The first part is the

ID: 3660360 • Letter: T

Question

This is a C++ project. There are 2 parts in this problem. The first part is the find the most efficient way to make change. The second part is determine how many ways are there to make change Find the most efficient way of making change for any amount of money up to $200.00. The most efficient way means the fewest pieces of currency. The following are the values of monies to use. $100.00 $ 1.00 $ 50.00 $ 0.50 (yes we do too!) $ 20.00 $ 0.25 $ 10.00 $ 0.10 $ 5.00 $ 0.05 $ 2.00 (yes we do!) $ 0.01 For example, if I were to give you change of $8.93, the most efficient would be 1

Explanation / Answer

please rate it!1
#include
using namespace std;

int main(int argc, char *argv[])
{


double purchaseAmount;
double paidAmount;
float balance;

int change, quarters, dimes, nickels, pennies, tenDollar, fiveDollar; // declare variables

cout << "Enter Total purchased amount" << endl;
cin >> purchaseAmount;

cout << "Enter Total paid amount" << endl;
cin >> paidAmount;

balance = paidAmount - purchaseAmount ;

tenDollar = balance / 10; // calculate the number of Ten Dollars
change = tenDollar % 10 ; // calculate the change needed
change = balance * 100;
quarters = change / 25; // calculate the number of quarters
change = change % 25; // calculate remaining change needed
dimes = change / 10; // calculate the number of dimes
change = change % 10; // calculate remaining change needed
nickels = change / 5; // calculate the number of nickels
pennies = change % 5; // calculate pennies

cout << " Quarters: " << quarters << endl; // display # of quarters
cout << " Dimes: " << dimes << endl; // display # of dimes
cout << " Nickels: " << nickels << endl; // display # of nickels
cout <<" Pennies: " << pennies << endl; // display # of pennies
cout <<" Ten dollar: " << tenDollar << endl; // display # of Ten dollar
//cout <<" Five dollar: " << fiveDollar << endl; // display # of Ten dollar

return (0);

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote