I am not looking to get code to help me, but just trying to figure out how to program up this assignment my teacher gave me. I can't think of how to describe it to be able to search it on google because everything I have tried isn't what I am looking for.
Question: My teacher wants us to program a fare calculator, my problem is that this has numerous combinations, for example there are 10 options to choose from plus having to account for how many people are wanting tickets.
I can't possibly write an if-else statement for all possible inputs, and I think I could do a combined switch case, but again I would have to program every case possible from those 10 options.
What approach would be best suited for when you don't know what options the user will select?
Question: My teacher wants us to program a fare calculator, my problem is that this has numerous combinations, for example there are 10 options to choose from plus having to account for how many people are wanting tickets.
I can't possibly write an if-else statement for all possible inputs, and I think I could do a combined switch case, but again I would have to program every case possible from those 10 options.
What approach would be best suited for when you don't know what options the user will select?