 All the programs you've seen so far are fairly small. This is on purpose. Each program has been designed to show a particular concept. For example, this program is written to show how nested if statements work. It doesn't concern itself with possible bad input, and it doesn't repeatedly ask the user for input. However, when we write programs for other people to use, we do have to take such things into consideration. That's what we're going to do in this video and the next one. What I'm not going to do is start writing the program right away. Programs written at the keyboard look like it, and that is not a compliment. Instead, I'm going to plan the program. Ordinarily, I'd do this with pen and paper, but my handwriting is almost unreadable, so I'm going to use a word processor. First, let's take the comments from the program, copy them, and paste them into the document. One approach that I find useful is to ask, what will this program look like when the user runs it? So what's my sample output going to be? First thing I'm going to do is I'm going to ask for the enter the customer's age, or zero to quit. And let's say they put in an age less than 16, say 12. Then I have to ask them for the day of the week. So I'll tell them to enter the day of week, where one equals Monday, and seven equals Sunday. And let's say they put in a four, and then I respond with the ticket price is $4.50. I'm going to be in a loop, so I'm going to ask for the customer's age again. Let me copy and paste that. And this time they say 25 years old. Now I have a design decision to make. Since the age is not less than 16, do I really need to ask for the day of the week? For people who are 16 or older, the day doesn't matter. So my decision is, no, I'm not going to ask for the day of the week. I can go directly and tell them what the ticket price is. And the ticket price is going to be $8.00 in this case. And then I go back to the loop, ask for the age. Now the question is, how do I handle error messages? For example, if somebody says negative two for the age, what would be a good error message? Oh, how about something like age must be from one to... Now, what's an upper limit for age? I'll put in 130 as a reasonable age, or they can put in zero to quit. So that's the error message I'll give them in that case. Let's say, again, we have somebody who's less than 16, and now we're going to ask for them to enter the day of the week. Let's copy that and paste it. And this time they're going to put in something invalid. What's a good error message for that? A day of week must be in range one through seven. And then it'll come back and ask them for the day of the week again. And they put in something like six, which is valid. And then I can tell them that the ticket price is $6. And I think on my output I'll put a period at the end of all of this sentences just to be consistent. Now that I have a good idea of what I want as a result, I'm going to print this out and have it next to me as I start the next step, which is writing the pseudocode for the program. I'll start off by declaring the variables in C. I need an integer for the age. I need an integer for the day of the week. And I need a double for the price. My first task is going to be to read the age and make sure it's in the range 0 to 130. Once I have that, I have to ask, okay, is that zero, which is my sentinel value or not? If the age isn't zero, then it's customer information and I have to process that customer info. That handles one customer, but I have to do that repeatedly. That means I'm going to indent this code and wrap it inside of a do-while loop. And the condition keeps going as long as I don't have a zero. Now let's break this step down further. What's involved in processing the customer information? Once I have the age, I have to ask if the age is less than 16. If that's the case, then I'm going to have to read the day of week and make sure it's in the range 1 through 7 and then calculate the ticket price based on the day. If it's not less than 16, I know the price. It's $8. Once I have the ticket price, I need to print that out. And there's my pseudocode. There's no guarantee that this will compile or run properly, but that's okay. This is my plan. This is my starting point. In the next video, we'll take this pseudocode and make it into a working program.