What does that mean? " If you had declared the decimals as doubles your values would have been correct "I declared a const that was a decimal, but it should be a constant. Can anyone point out the simple mistake? ( I learn something every time I post here :-D )
#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
//lZ is twelve and B is eight
//cont is container, bo is Backorder
int lZhearts, Bhearts, lZcont, Bcont, lZbo, Bbo;
//Constants
constint lZihpc =20; //the 20 twelve inch hearts per container
constint Bihpc =32; //the 32 twelve inch hearts per container
constint lZic = 42.50; //for the cost of lZ inch containers
constint Bic =48.50; //for the cost of B inch containers
//Crt is Cost Container
cout << " 20 twelve inch hearts per container.\n 32 eight inch hearts per container "<< endl;
cout << endl;
//lZ inch heart user input
cout << " Enter the number of 12 inch hearts: "; cout << setw(20);
cin >> lZhearts;
//B inch heart user input
cout << "\n Enter the number of 8 inch hearts: "; cout << setw(20);
cin >> Bhearts;
cout << endl;
//Format
//captured output
cout << " The number of 12 inch hearts = "<< setw(30) << lZhearts << endl;
cout << " The number of 8 inch hearts = "<< setw(30) << Bhearts << endl;
cout << " The number of full 12 inch containers = " << setw(20)<< lZhearts/lZihpc << endl;
cout << " 12 inch hearts on backorder = "<< setw(30) << lZhearts % lZihpc << endl;
cout << " The number of full 8 inch containers = "<< setw(20) << Bhearts / Bihpc << endl;
cout << " 8 inch hearts on backorder = "<< setw(30) << Bhearts % Bihpc << endl;
double lZcrt = lZhearts/lZihpc;
double Bcrt = Bhearts / Bihpc * Bic;
cout << " Cost of 12 inch hearts shipped = "<< setw(27) << lZcrt * lZic << endl;
cout << " Cost of 8 inch hearts shipped = "<< setw(30) << Bcrt << endl;
double total = lZcrt + Bcrt;
cout << endl;
cout << " Total cost = "<< setw(48) << Bcrt << endl;
system("PAUSE");
return 0;
}