Hello, I'm in my first class about C and I need some help with this problem please.
The code is not getting the expected value in variable twoHundredFiftyScholarship.
When using the debugger I can see that the only value that is incorrect is for variable [tag]twoHundredFiftyScholarship[/tag].
The expected value for variable [tag]twoHundredFiftyScholarship[/tag] when entering the sample run #1 should be 1. The value I get is 3.
same thing with for sample run #2. The expected value is 8. The value I get is 48.
Could someone guide me toward the right direction please? I'm kind of confused on why this is happening and I'm stuck. Thank you!
Code:
if(thousandScholarships > 5){
thousandScholarships = 5;
remainingScholarship -= thousandScholarships*1000.0;}
if(fiveHundredScholarship > 10){
fiveHundredScholarship = 10;
remainingScholarship -= fiveHundredScholarship*500;}
remainingScholarship -= twoHundredFiftyScholarship*250;
system("pause");
return 0;
}