need help with this

it says

Write a program to calculate the salary as per the following table

here is the table

[IMG]http://i40.tinypic.com/2hxy8nc.jpg[/IMG]

I can only get to where it asks to give your graduate thing

Post your code.

Aceix.
ok give me 2 minutes i got upset and erased it all lol it will nly take me a mn to get it back. i know its wrong i just dont know why it is wrong
#include<iostream>
using namespace std;

void main()

{

char gen;
char grad;



cout<<"Please enter your gender using M or F\n";
cin>>gen;

if(gen == 'M'|| gen == 'm')
{
cout<<"please enter your graduate level put P for post graduate or G for graduate\n";
cin>>grad;
}


}



NOW IF I TRY TO PUT A IF INSIDE THAT IF STATEMENT IT DOESNT SEEM TO WORK RIGHT FOR ME, i AM having the issue if getting all the way to the end level of the problem
I think I figured it out,
Try this
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
#include<iostream>
using std::cout;
using std::cin;
using std::endl;


int main(){

char
	gen,
	grad;

int
	salary=0,
	yearsOfService;



cout<<"Please enter your gender (using M=Male,F=Female): ";
cin>>gen;
if(gen=='M'||gen=='m'){
		
cout<<"\nYears of service: ";
	cin>>yearsOfService;
	if(yearsOfService>=10){
		cout<<"\nNow enter your graduate level P=post graduate G=graduate: ";
		cin>>grad;
		if(grad=='P'||grad=='p')
                        salary=15000;
                else
                        salary=10000;
	}else{
		cout<<"\nNow enter your graduate level P=post graduate G=graduate: ";
		cin>>grad;
		if(grad=='P'||grad=='p')
			salary=10000;
		else
			salary=7000;
	}//end if else
	cout<<"\nYour salary is: "<<salary<<endl;			
}else{

	if(gen=='F'||gen=='f'){
		cout<<"\nYears of service: ";
        	cin>>yearsOfService;
		if(yearsOfService>=10){
			cout<<"\nNow enter your graduate level P=post graduate G=graduate: ";
			cin>>grad;
			if(grad=='P'||grad=='p')
                        	salary=12000;
                	else
                        	salary=9000;
				cout<<"\nYour salary is: "<<salary<<endl;
		}else{
			cout<<"\nNow enter your graduate level P=post graduate G=graduate: ";
			cin>>grad;
			if(grad=='P'||grad=='p')
                        	salary=10000;
                	else
                        	salary=6000;
				cout<<"\nYour salary is: "<<salary<<endl;
		}//end if...else
	}else{
		cout<<"Only M,m F,f..."<<endl;
	}//end if...else

}//end if...else


return 0; //indicates success
}//end main 


Please enter your gender (using M=Male,F=Female): m

Years of service: 10

Now enter your graduate level P=post graduate G=graduate: p

Your salary is: 15000

Please enter your gender (using M=Male,F=Female): M

Years of service: 10

Now enter your graduate level P=post graduate G=graduate: g

Your salary is: 10000

Please enter your gender (using M=Male,F=Female): F

Years of service: 10

Now enter your graduate level P=post graduate G=graduate: P

Your salary is: 12000

Please enter your gender (using M=Male,F=Female): d
Only M,m F,f...
Topic archived. No new replies allowed.