I have to use void functions for my class. I'm wondering why my output isn't coming out correctly? I keep getting 75 for each line of output. Your points depends on the user monthly purchase amount. The math is in void functions below.
You are making your calculations with locally scoped variables in each function that go out of scope when each function returns. userTotal retains the same value in main whether you call your functions or not.
Since you have to use "void" functions I get the idea that the assignment is about passing by reference.
Therefor the variables "standardTotal", "plusTotal" and "premiumTotal" should be defined in "main" and passed by reference so that the variables in "main" will change and you can use those variables in the "cout" statements insted of "userTotal" which never changes.
Instead of using magic numbers in the functions, (0.4, 0.15) ets., define constant variables for these. You can either define them in the function or as global variables to the whole file. I would consider putting at the top of the code where they can easily be found if a change is needed.
You did not offer any test data with expected output, so I am not sure if everything is working correctly, but I did manage this output:
Please enter your total monthly purchase amount ($0.00): 100
Standard membership points this month: 8
Plus membership points this month: 6
Premium membership points this month: 4
Press Enter to continue:
Please enter your total monthly purchase amount ($0.00): 150
Standard membership points this month: 15
Plus membership points this month: 20
Premium membership points this month: 6
Press Enter to continue:
Please enter your total monthly purchase amount ($0.00): 200
Standard membership points this month: 20
Plus membership points this month: 26
Premium membership points this month: 30
Press Enter to continue:
Please enter your total monthly purchase amount ($0.00): 225
Standard membership points this month: 23
Plus membership points this month: 29
Premium membership points this month: 34
Press Enter to continue: