C++ User input

Status
Not open for further replies.

locutus24

[H]ard|Gawd
Joined
Sep 13, 2004
Messages
1,642
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?
 
I think you need to elaborate on the nature of the requirements a bit more.

There are "ten options" plus you have "to account for how many people are wanting tickets"

Are you saying that, for each rider, that rider may choose an option?
 
I think you need to elaborate on the nature of the requirements a bit more.

There are "ten options" plus you have "to account for how many people are wanting tickets"

Are you saying that, for each rider, that rider may choose an option?

That is the problem I am having myself being able to understand the problem. I have 10 the user can select 2 options for that combination which I think that would mean 20 combinations possible, not something I could account for at compile time.
 
Status
Not open for further replies.
Back
Top