Hey guys, I was doing my reading last night and was trying to come up with a program other than the practice assignments. It has been hard remembering all the keywords when they are given to you in the practice assignment. I came up with one and kinda got myself in a corner which is good because it is making me think and I am starting to remember these key words better. This is my first C++ class so I might be getting ahead of myself, just say so if I am. I am learning about switch, case, if, and else and I ran into this problem. In the practice assignment we are only working with two possible routs for the case switch. for example:
What type of customer are you <R or B>?
switch (customerType)
case 'R':
case 'r':
blah blah blah......................
case 'B':
case 'b':
blah blah blah......................
So I was coming up with a practice of my own that was about a restaurant, it asks:
Did the customer have drinks from the bar(Y or N):
Did the customer have appetizers (Y or N):
Did the customer have dessert (Y or N):
If they answer Yes to any question they get some more questions reffering to that subject, which I know how to do, what I don't know how is if they answer No, is there a way to make it skip to the next question without me having to type the script everytime they answer No or Yes. I know there has to be a way where I only type out everything once, right? I can do it on the algorithim ;) I know that is the hardest part and takes a very intellegient person to draw the lines haha if someone could, please show me an example of how to make it skip to another part of the code. I probably just haven't got to it yet in class but I would like to know anyway.