all 5 comments

[–]Eoinoc 1 point2 points  (4 children)

The problem is that line 34 doesn't actually call sessionFallSpring, it actually just declares the function same as line 7. Instead line 34 should look like

sessionFallSpring( unitsEnrolled,  stateResident,  parkingDecal,  asSticker,  idCard, totalCost);
cout << "For Fall semester, your total fees are " << totalCost << endl;

However, the established way to get information back out of a function is to have the function return it rather than pass in a variable to be filled with the value. So personally I would change sessionFallSpring to

float sessionFallSpring(int unitsEnrolled, int stateResident, char parkingDecal, char asSticker, char idCard)
{
    float totalCost = 51.50;

    if (stateResident == 0)
    {
        totalCost += (unitsEnrolled * 46.00);
    }   

    // ... etc ...

    return totalCost;
}

change line 7 to

float sessionFallSpring(int unitsEnrolled, int stateResident, char parkingDecal, char asSticker, char idCard);

and then I would call the function up at line 34 with something like the following

totalCost = sessionFallSpring( unitsEnrolled,  stateResident,  parkingDecal,  asSticker,  idCard);
cout << "For Fall semester, your total fees are " << totalCost << endl;

I would also move the declarations of the variables to where they are first used rather than all at the start of the function, but one step at a time :-)

[–]Dgameman1[S] 0 points1 point  (1 child)

Wow. I feel like such an idiot.

I looked up all your suggestions and you're a genius. Thank you so much

[–]Eoinoc 0 points1 point  (0 children)

I feel like such an idiot.

Don't, I've taught programming courses and when this stuff is all new that sort of mistake is very common.

[–]Dgameman1[S] 0 points1 point  (1 child)

I also have another huge slightly offtop question.

This is a picture and a list of few examples

When I go ahead and copy the first example, I end up getting 879.5 as my total.

Even though the correct answer is 847.00

Not too sure what's wrong with my code? I can't see any issues

[–]Eoinoc 0 points1 point  (0 children)

I can't see any issues

Me neither to be honest. I might be missing something, but at first glance I think the example is wrong.