 Okay, so step one always input Here step two Process part and then step three output Okay, I always mention this money a couple times because this is the basis of writing programs So that's what we're gonna do the first step and let me just add some lights in here What do we need for input? Okay, so you're gonna gather all your data for your input and I highly recommend that you use variables to store your data do not try to Use numeric literals if possible at all Unless those numbers are very very simple like just counters or for no meaning at all that's fine but if you look at this like 65 is a very specific number that is Used to represent senior citizens, right or 12 is an another number that represents children So you don't want to say if age is equal to number 12 You want to say something like child age? Okay, we'll see a senior age or something like that. So They are more meaningful in your code So with those information you would do something like this. Maybe like senior age is going to be 65 and The reason why I use variable is because if you use this variable many times in your code If you want to change your senior age or something else as you can see some places some stores You know the senior age is actually 55 to get some discounts, right? It's not always 65 So you so you make one change here all the places in your code are changed automatically So that senior age you can also do one for a child age. This is 12 and You know anything above 12 in between between then it'll be about age So in this case, you don't really care, okay? Unless you want to use that again in a code, that's fine but this this example that you don't really have to care about the adult age and so those are pretty Very specific to the age and then you can also have the price to us as well, right? The price because the price could change So again, don't use it in your code. I mean literally use the variables. You can say senior price is equal to five dollars and the child price is $3 The adult price you have to have one for that as well. It's four dollars. No, I'm sure I had it wrong So here is four dollars Okay, so those are my variables. I will use in my calculation and Then now I need to read the input Okay, it says if you have if there are still people in the line Since I'm not reading data from a file anything I'm going to mimic that example by using the input statement So I want to say something like more people is Equal to read from the input It'd be very simple More people and then I'll just say yes or no Okay, if you enter yes, then it's going to keep processing that That information so that would be like if there's two more people in line Okay, and then here is the loop right the process So we'll do something like again while more people Is what? Right. Well, it is true or in this case would be yes. So in this example here again, I'm using the letter y Right, not ideal. You could say something over here The actual character y or another variable to store for y Because if you want to be used that again, so in this case, I'll just leave it here. It's fine It's just a very simple use one time But I'm using a capital y. So I want to convert the entire input to the uppercase Right, so it doesn't matter into lowercase uppercase is going to be forced uppercase if that is true That that means I have more people to process Okay, so your process What do you do? And so here the signal value to stop this loop is when the result or the input is an Right, so signal value is the end because it will cost you a lot to stop So then once I inside the loop Then you need to check if And again, this was a little bit tricky, right? So senior citizens um Who have has a zoo membership gets free gift that only applies to senior citizens But everybody else who have a zoo membership gets in free Okay, including senior citizens who are not a member Right, so be very careful here. You're gonna have to look here Which is which one should occur first? And I talked about this last week that the order of your if statements is really important in this kind of scenario Because if you don't do it correctly, you've got to get an incorrect result because this so you would measure the membership first Before you even calculate all these prices Because of this this part right here Okay So that means you would want to check for that membership first, but You need to get the information. So in this case again, we don't have data So I'm just going to get it from the user from the input Right. So you can say Member is I'm going to read that from the input again Just say member And I put here. Yes. No I would just say that is Yes or no for that for that user or that guest And then now once I get the membership information, then I need to read the age so I can say age is integer and I get the input Enter age I got my two data So once I have this information Then I can check the membership first, right? So I can just do something like if Member Is equal to again. Yes. So again the same as I did up here. I want to put the upper here It's uppercase If they are a member Then the price is free Okay, so When you write this kind of code, don't print right here Remember output the separate right input your process output So what do you do? You have to use a variable to store the price. So you do something like this price equals zero Right because membership gets Zero price. There's no cost for that And then inside here while you're a member this applies to all people Who are a member but the senior citizens have a special gift So then inside the if block you have to also check for their age Right. So if age is greater or equal to senior age If that is true Then they get a message, right? Again, don't print it here. You use a variable something like a message You receive A free gift I think something like that Right Otherwise, that's it They only get a free price. Okay And then here is the elsewhere if you are not a member right but They have the other branch if they're non-members, then this is where you calculate their actual price. So you do it again if your age is less than or equal to the child age Then the price is equal to the child price okay Else if your age is greater or equal to senior age oops Then price is equal to senior price And then here's the else part right else. It must be a parent. I mean adult So you get all this information here And then you need to print each message to the user Uh, I have it here. Here's um adult personal. I don't have it. Uh, I don't I do oh, let me spell Okay, so we gather the formation and then finally Right before we move on to the next person We want to print the information. So the step three is actually output, but it's inside the well loop So you output here you can print The total here say um your price is and then you put here The price and for formatting purposes you can put here the dollar sign for dollar sign Uh, you use this uh percent dot Two f or two decimal places using a float Okay, and then percent outside the quote and then the name of this price is just called price I'm formatting that to the price But you also want to print the message if the if you are a senior So how do you print this message right? You can just print it if you print you can get an error Because it's not defined outside here So if you go to else part And this never run Message is never used if I try to print message down here. It's going to fail. So if I do this It's going to fail. You're going to have an error Okay, so what you do then okay, since I'm using a message Then it's also wise to go up here and set your message to blank or in this case You could put like a none Okay, none or blank it doesn't matter And then you also want to set the price Okay To zero So you reset for every individual person You reset the message you reset the price to zero and then get the information and process it Then print that information for that user you repeat for the next person if there's any And finally we need to update I'm going to update this this part here, right? So again, this Needs to go down here again in the bottom of your code This is the update part Okay, if you don't update it's going to cause an infinite loop So here we go. Let's give it a try and see if it works And uh over here So if I say more people, okay, if I said no then it ends, right? Because we exit out the loop and I did not put any message out here. So Nothing's shown there, but you could say thank you for playing whatever, right? Well, thank you for visiting But let's run it again this time. I'm going to go. Yes I'll say yes notice. I put a lowercase y it's fine, right And in my member, this is the next question right here and if I put no Then it's going to ask for my age and let's go to five So I expect to get the child price, which is three four dollars for three dollars. Yeah And the message here says none Like there's no message It prints it anyway because I set to to be none so You should print nothing there, right? If it's if it's not a senior who has membership So again, I repeat again and notice I keep going until I reach an end So if I go yes again And this time I'm going to put a senior. So I'll say A member yes I'm a senior. Let's say I'm put 70 years old And there it is the price is free. I get a free gift for senior only Okay, remember again. Okay. Yes This time I'm a member. I am an adult And I get the price in free. I get none for the message. So in this case, the message is displayed every time If you don't want to display the message Then you have to do an if statement to check it Right And then if I if I go no, then I'm done over here Okay, so if you don't show this message You can check the state of the message variable here if message is not equal to none Then print a message. Otherwise, don't print it because the only way is not A none is if you go to this line Right, so you can say if message Is this message is not equal to none Then only then you're going to print the message Otherwise, don't print it Okay, so let's see if that works So people yes member No, and then I enter applied and you see this normal message is to print I go yes and I'm a senior And then oops, that's incorrect. That's going to be an error Okay, because I did not validate that correctly. So remember yes age is 70 And there it is. I got a free gift because the text has been set And now again to exit out All right, so this is how you would translate That pseudocode to the flowchart to the actual code