I am writing a program that is suppose to ask for the type quantity and size of the lumber that is to be ordered. It is suppose to print the quantity, size, type and cost. Then the program is suppose to total the whole order. So far I am working on getting my program to print correctly. Every time I enter my information the type of wood printed is Pine and I get $0 for the cost. Can someone please explain to me where I am going wrong. Thank you!
Code:
#include <string>
#include <iomanip>
#include <iostream>
using namespace std;
char chr;
int main()
{
string order;
float P;
float F;
float C;
float M;
float O;
float T;
P=0.89;
F=1.09;
C=2.26;
M=4.50;
O=3.10;
int quantity=0;
int width=0;
int height=0;
int length=0;
char type;
float cost;
float bmeasure; bmeasure=(width*height*length)/12;
cout<<"Enter item: "<<endl; // the user enters their order
cin>>type>>quantity>>width>>height>>length;
//stores the information
cost=bmeasure*quantity*type;
if(P)
{
cout<<quantity<<" "<<width<<"x"<<height<<"x"<<length<<" "<<"Pine"<<", "<<"cost: "<<"$"<<cost<<endl;
}
else if(F)
{
cout<<quantity<<" "<<width<<"x"<<height<<"x"<<length<<" "<<"Fir"<<", "<<"cost: "<<"$"<<cost<<endl;
}
else if (C)
{
cout<<quantity<<" "<<width<<"x"<<height<<"x"<<length<<" "<<"Cedar"<<", "<<"cost: "<<"$"<<cost<<endl;
}
else if(M)
{
cout<<quantity<<" "<<width<<"x"<<height<<"x"<<length<<" "<<"Maple"<<", "<<"cost: "<<"$"<<cost<<endl;
}
else if (O)
{
cout<<quantity<<" "<<width<<"x"<<height<<"x"<<length<<" "<<"Oak"<<", "<<"cost: "<<"$"<<cost<<endl;
}
cin>>chr;
return 0;
}