pass-by-reference help

I have written the following to code calculate and display raises of 5% and 10%. My output is not calculating the 10% raise correctly. Any idea what I am coding wrong?

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
  void fivePercentRaise(double &);
double tenPercentRaise(double );

int main()
{
	double salary = 0.0;
	
	cout <<"Please enter current salary: ";
	cin >>salary;
	
	fivePercentRaise(salary);
	tenPercentRaise(salary);
	
	system("pause");
	return 0;
}
void fivePercentRaise(double & sal)
{
	sal= sal + sal * 0.05;
	cout <<"New salary if you receive a 5% raise: " << sal << endl;
}

double tenPercentRaise(double sal)
{
	double newSal = sal + sal * 0.10;
	cout <<"New salary if you receive a 10% raise: " << sal << endl;
}
LOL I hope you aren't serious.

http://www.cplusplus.com/forum/beginner/148402/
Topic archived. No new replies allowed.