Ripoff University charges $3000 per semester for Canadian students and $10000 per semester for foreign students. In addition, dormitory fees for Canadian students are $2500 while foreign students pay $5000. Finally, in addition to this the university charges an extra $500 dollars for any student who requires a parking permit for the semester. Write a program that asks the user for their student status and if they need a parking permit.(Use a simple Y or N answer for this question) The program should then calculate the total cost for the semester and display this information to the screen
When I run it I get to the (y/n) part and it just displays both answers for no output
char Choice, y, n; Choice, y, and n are uninitialised cin >> Choice; choice now holds a value if (Choice = y) y is still uninitialised
You're using the operator "=" wrong. I think you meant to use "=="
I think you meant to use if (Choice == 'y'), in which case you don't even need the variables char y, n;