Write a program that will input the amount of chairs sold for each style. It
will print the total dollar sales of each style as well as the total sales of all chairs in fixed point notation with two decimal places.
The program runs fine I am just have problems with the output.
I have tried a few different methods for the fixed point notation, but I am getting results like 324.5 rather than 324.50?
#include <iostream>
usingnamespace std;
int main()
{
//Declares variables for chairs
float americanColonial;
float modern;
float frenchClassical;
//Sets the price for the chairs
americanColonial = 85.00;
modern = 57.50;
frenchClassical = 127.75;
//Declares variables for number of chairs sold
int numOfAmericanColonial;
int numOfModern;
int numOfFrenchClassical;
float total;
//Prompts the user for the number of chairs
cout << "Please input the number of American Colonial chairs sold: ";
cin >> numOfAmericanColonial;
cout << endl;
cout << "Please input the amount of Modern chairs sold: ";
cin >> numOfModern;
cout << endl;
cout << "Please input the number of French Classical chairs sold: ";
cin >> numOfFrenchClassical;
cout << endl;
//Calulates the totals and prints the results
cout << "The total sales of American Colonial chairs: $" << numOfAmericanColonial * americanColonial << endl;
cout << endl;
cout << "The total sales of Modern chairs: $" << numOfModern * modern << endl;
cout << endl;
cout << "The total sales French Classical: $" << numOfFrenchClassical * frenchClassical << endl;
cout << endl;
total = (numOfAmericanColonial * americanColonial) + (numOfModern * modern) + (numOfFrenchClassical * frenchClassical);
cout << "The total sales of all chairs: $" << total << endl;
cout << endl;
system ("pause");
return 0;
}