@buttersdaman000:
#include <iostream>
using namespace std;
#include <string>
#include <iomanip>
int main()
{
std::string name;
double quarters, dimes, nickels, pennies;
float total;
//Get the name of the user
cout << " What is your name?";
cin>> name;
//Get the amount of quarters
cout << "How many quarters do you have?";
cin >> quarters;
//Get the amount of dimes
cout << "How many dimes do you have?";
cin >> dimes;
//Get the amount nickels;
cout << "How many nickels do you have?";
cin >> nickels;
//Get the amount of pennies
cout << "How many pennies do you have?";
cin >> pennies;
//Get the total
total= (.25*quarters)+(.1*dimes)+(.05*nickels)+(.01*dimes);
cout << "Your Name:" << setw(17) << name << endl;
cout << "Number of quarters:" << setw(9) << quarters << endl;
cout << "Number of nickels:" << setw(12) << nickels << endl;
cout << "Number of pennies:" << setw(12) << pennies << endl;
cout << "Total amount:" << setw(13) << total << endl;
return 0;
}
Log in to comment