hello, I'm a beginner to c++ and I'm having a hard time starting it. I don't want it done for me I just want it explained more in detail. the assignment is that a university has asked me to write a program that takes in a students GPA and SAT test scores and with that information they are either waitlisted accepted or denied. a 4.0 GPA being accepted automatically.
So basically the idea is that you are going to have a bunch of if statements. Your first layer will find between which margin their GPA is then depending on their GPA the next layer will look at where their SAT score is and depending on that you can set the result.
if (GPA >= 3.5 && GPA == 3.99) This wouldn't work, can you see why? ( <= 3.99? )
Since you want to solve this yourself, and that is good, I'd suggest you forget about coding for a while and write down some pseudocode particularly expanding on the 'business rules' you have been given.
That way the if statement cascade if, else if ..., else etc will be easier and clearer to you.
- if (GPA >= 4.0) then accepted
- otherwise if GPA between 3.5 and 3.99, and SAT greater than 1400, then admitted
- otherwise ...
etc etc
Also use 'and' 'or' instead of && and || if your compiler allows it. It's clearer.
this assignment has me stressed out. I have been working on it for 4 days and I still cant wrap my head around it. but thanks for your previous help/tips. ill take a look at the book again to se if it helps out also.
thank you so much Kemort. what made more sense to me of the code you wrote is the separation of each rule. I wasn't looking at it as multiple little puzzles. I was looking at it as one giant problem and a mixture of over thinking made me not understand it. now I do understand it and I managed to finish it and it works perfectly.