cin problem

I want to type a Package Letter that's equal to a Number to cin >> Package;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 #include <iostream>
using namespace std;

int main ()
{
	double order;
	double Package;
	int A = 400;

	int a = 400;
	int B = 500;
	int b = 500;
	int C = 1000;
	int c = 1000;
	int D = 1200;
	int d = 1200;
	double Tpackage;
	double counter;
	
	
	counter = 0;
	Tpackage = 0;
	
	
	cout << "Welcome to Susy Catering "<<endl;
	cout << "Food Package's"<<endl;
	cout << "Package A ...... $400"<<endl;
	cout << "Package B ...... $500"<<endl;
	cout << "Package C ...... $1000"<<endl;
	cout << "Package D ...... $1200"<<endl;
	
	cout << "Enter how many Orders of Package: ";
	cin >> order;
	
	for(counter = 0;counter < order;counter++)
	{

		cout << "Enter Package :";
		cin >> Package;
		
		Tpackage = Tpackage + Package;
		
	}
	cout << "Your Total Order cost is : $"<<Tpackage<<endl;
	
	system ("pause");
	return 0;
}
aloud9 wrote:
I want to type a Package Letter that's equal to a Number to cin >> Package;
I don't understand what you mean, could you try to phrase it differently?
in the "Cin >> Package" I want to type Letter A that is equal to 400 and Letter B=500 Letter C=1000.
My program wont accept Letters.
You want to make the Package variable either a char or a std::string. Also, your other variables should probably be integers, not doubles - especially counter should not be a floating point type.
Topic archived. No new replies allowed.