what am I missing or doing wrong

I am trying to finish my midterm project and at line 10 when I enter what I want from line 11 to the end of the code is displayed can someone tell me why I am trying to get it to where I can pick an option and it'll tell me and then display the next line of code and let me pick from the next option
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
#include <iostream>
#include <cmath>
using namespace std;
int main()
{

	char package, plan, A, B, C, lines;
		cout << "Choose a plan, choose from A,B,C. Choose 'A' for no contract single line, Choose 'B' for no contract family plan, or choose 'C' for a two year contract" << endl;
	cin >> plan;
		cout << "You choose plan " << plan << endl;
		cout << "Now pick a package for plan 'A' pick from '1' which includes unlimited voice, and texting for 30 dolllars a month. '2' which includes unlimited talk,text,multimedia messaging and 200 MB of data for 35 dollars a month. '3' which includes unlimited talk, text, multimedia messaging and 2.5 GB high speed data and unlimited data at reduced speeds after that for 45 dollars a month. For plan 'B' choose from '1' which includes unlimited talk, text, multimedia messaging, and 8 GB shared data for two lines for 100 dollars a month. '2' which includes unlimited talk, text, multimedia messaging, and 15 GB shared data for up to four lines for 130 dollars a month. Plan 'C' choose from '1' which includes unlimited talk, text, multimedia messaging, annd 3 GB high speed data and unlimited data after that at reduced speeds for 70 dollars a month for an unlimited amount of lines plus an additional 20 dollars a month per line if you want to buy a phone. pick '2' if you want to buy a phone" << endl;
	cin >> package;
		cout << "You choose package " << package << endl;
		cout << "If you picked plan C please enter the number of lines you need" << endl;
		cin >> lines;
		cout << "Thanks for choosing Quick Wireless" << endl;
	
		
			


	system("pause");
	return 0;

}
What is your problem, I can't find the actual question your post.

Also, I would suggest using getline(cin, plan) and getline(cin, package) instead of a standard cin.
at line 10 it outputs you choose plan x where x is A,B, or C and then instead of letting me pick a package it outputs the rest of the code from line 11 till the end
Oh I see. Try using a cin.ignore(); just before the cin at line 12.

If your program is actually skipping the cin at line 12, this should fix it !

1
2
cin.ignore();
cin >> package;
Last edited on
ok thanks just now seeing this i added it and then ran out of time so i had to summit it hope it works
You remind me some people im at university with :P Handing out their programming assignement at the last minute haha. Good luck mate
Topic archived. No new replies allowed.