PLEASE HELP!!

the output is not printed properly when the user inputs any of the values..
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
70
71
72
73
74
75
std::cout<<"\n 1. Managing Director \n 2. Director \n 3. General Manager \n 4. Deputy General Manager \n 5. Chief Manager \n 6. Senior Executive \n 7. Executive \n 8. Officer \n 9. Clerk \n 10. Sub-Staff \n Enter designation number : ";
    std::cin>>no2;
    ba_sal=0;
    do
    {
    switch(no2)
    {
    case '1' :     std::cout<<"\n MANAGING DIRECTOR";
                   ba_sal=800000;
                   break;
    case '2' :     std::cout<<"\n DIRECTOR";
                   ba_sal=500000;
                   break;
    case '3' :     std::cout<<"\n GENERAL MANAGER";
                   ba_sal=300000;
                   break;
    case '4' :     std::cout<<"\n DEPUTY GENERAL MANAGER";
                   ba_sal=150000;
                   break;
    case '5' :     std::cout<<"\n CHIEF MANAGER";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal<80000||ba_sal>100000)
                   {
                       ba_sal=0;
                       std::cout<<"\n CHECK SALARY";
                   }
                   break;
    case '6' :     std::cout<<"\n SENIOR EXECUTIVE";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal<65000||ba_sal>85000)
                   {
                       ba_sal=0;
                       std::cout<<"\n CHECK SALARY";
                   }
                   break;
    case '7' :     std::cout<<"\n EXECUTIVE";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal<50000||ba_sal>80000)
                   {
                       ba_sal=0;
                       std::cout<<"\n CHECK SALARY";
                   }
                   break;
    case '8' :     std::cout<<"\n OFFICER";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal<40000||ba_sal>75000)
                   {
                       ba_sal=0;
                       std::cout<<"\n CHECK SALARY";
                   }
                   break;
    case '9' :     std::cout<<"\n CLERK";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal<25000||ba_sal>40000)
                   {
                       ba_sal=0;
                       std::cout<<"\n CHECK SALARY";
                   }
                   break;
    case '10':     std::cout<<"\n SUB-STAFF";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal<15000||ba_sal>25000)
                   {
                       ba_sal=0;
                       std::cout<<"\n CHECK SALARY";
                   }
                   break;
    }
    }while(ba_sal==0);
the output is not printed properly


Not very useful/helpful for us...

What data type is "no2"? if it's an int, then remove all the ' from the case statements, i.e. they should NOT be characters.
Last edited on
yes that helped! thank you :D
Topic archived. No new replies allowed.