Problems with a simple menu

Good evening, I am new to C++ and I'm having a bit of trouble with a simple menu
I'm trying to generate a menu with two options; one is used to calculate the amount of sales, and the other one is to simple shut down the application

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <iostream>
#include <string> 
#include <cmath>
using namespace std; 

int main ()

{
	int loop = 1; 
	int choice;
	double sales;

	while (loop ==1)
	{
	
		cout << "::MENU::\n\n" 
			 << "1. Calculate \n"
			 << "2. Exit \n";
		cin >> choice; 
		switch (choice)
		{
		case 1:
				
			system ("CLS"); 
			cout << "To calculate, please type in the the number of sales \n\n";
			cout << "Keep in mind that \n";
			cout << "Sales 1 - 100,000 will be multiplied by 2% \n";
			cout << "Sales 100,001 - 400, 000 by 5% \n";
			cout << "Sales 400,000 and over by 10% \n\n";
			cin >> sales; 

			if (sales <= 100,000)
			{
				(sales*.02);
				cout << "The amount of sales is " << sales << endl; 
				system ("pause");
			}

			else if (sales >= 100,001 && sales <= 400,000) 
			{
				(sales*.05);
				cout << "The amount of sales is " << sales << endl; 
				system ("pause");
			}

			else if (sales > 400,000) 
			{
				(sales*.1);
				cout << "The amount of sales is " << sales << endl;
				system ("pause"); 
			}

		

		case 2: 

			if (choice ==2) 
			{
				exit (0);

			}

		}


	}


}


The compiler does not show any errors, but while I am running the application, it doesn't display the amount of sales whenever I type in the digits, it just goes back directly to the selection menu. Can anyone tell me what I am doing wrong? Any help will be appreciated
Last edited on
Topic archived. No new replies allowed.