Write a C++ program which inputs the amount of chairs sold for each of three chair styles Style Price Per Chair American Colonial $ 85.00 Modern $ 57.50 French Classical $127.75 The program must 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.
#include <iostream> #include <iomanip> using namespace std; int main(){ int a, m, f, aTotal, mTotal, fTotal; double total; cout<<"Number of American Colonial chairs ($ 85.00 each): "; cin>>a; cout<<"Number of Modern chairs ($ 57.50 each): "; cin>>m; cout<<"Number of French Classical chairs ($ 127.75 each): "; cin>>f; cout<<fixed<<setprecision(2); aTotal = a*85.00; cout<<"Total sales for American Colonial chairs = "<<(aTotal)<<endl; total = aTotal; mTotal = m*57.50; cout<<"Total sales for Modern chairs = "<<(mTotal)<<endl; total += mTotal; fTotal = f*127.75; cout<<"Total sales for Modern chairs = "<<(fTotal)<<endl; total += fTotal; cout<<"Total sales of all chairs = "<<total<<endl; return 0; }
Get Answers For Free
Most questions answered within 1 hours.