Welcome to Lesson six input processing and output. We're going to talk about several different subjects in this section. But the first thing we're going to start off with is designing a program. So before we get started on your input processing output subjects first thing we want to do before we even get started writing any code is to design our program. There's a lot of reasons why you want to design the program first. It's super important when it comes to logical errors.
You know, if we're going to print out paychecks for all of our employees, we have to make sure we know how many hours they put in whether or not they did overtime and what their rate of pay is before we can do those computations in order to print their paycheck. So design before you start typing, it's very, very important. And while I do Use a very obvious thing to, you know, example in order to explain it. I that is an obvious example, when you get into a lot of code, it may not be so obvious. And so we've got to lay it out little by little, so that we can know exactly what's going on with the program and trying to make sure that everything is going to be put in there properly. So design before you type, there is something called a program development cycle.
And this is just a cycle that we follow when we develop programs. So the first thing we have to do is we have to design the program. So we have to know all of everything that is going to be required in order to run that program. The next thing that we have to do is write the code. And once we get the code written, we're going to run it and see if we have any syntax errors. So if we misspelled a variable if we didn't put a parenthese, where it belongs, if we didn't put a quote where it belongs.
All of those things are syntax errors. They can be quite frustrating as every single language has its own rules. So make sure you get to know those, make sure you capture those, then you're going to test the program. And if there are any logic errors, you're going to correct the logic errors. And again, your logic errors are just having things that, you know, maybe you have a computation and you're trying to do some math, and you don't actually know what a certain value is first, or the program doesn't know what the value is first. And so boom, program crashes.
And that would be why logic airs. So another thing that we talk about when we talk about design is we talk about the GUI itself. So in a GUI, that's the user interface, that's everything that the user is going to click on everything that the user is going to see. It needs to Be user friendly. So it's super important to make sure that you work with a customer. You know what the program is supposed to do?
You ask questions about the program details. And then you create those software requirements. Those are incredibly, incredibly important and they have to be locked down. Typically what happens once you get into the programming environment and you're doing programming all the time is that you're going to come up with a program, you're going to design it, going to make sure that it works the way that it's supposed to do, you're also going to have to probably design a GUI that works, and you have to talk to them and lock down the actual design on that GUI because if it's not user friendly, and things aren't where they think they should be, then you're going to have a little bit of an issue. The software requirements are extremely important because what happens again, when you go out working in the field, you're gonna have people that are constantly testing, the software that you build, you'll run a few tests, you know, you'll have to run it, make sure that everything goes through.
Make sure that it clears you don't get Any syntax errors or any logic errors. But the real test comes when either software testers are tearing your program apart, or it's out into production and people are actually using it because oftentimes users don't know what they're doing. And so if they do something wrong, then what really happens with the program? Does it cause it to crash? can we fix it? What's going on?
So all of those things are extremely, extremely important. So your next question should be okay, Miss halleck. You've talked about all these great things on designing a program, but how do you get started actually designing a program? We know the important things that we have to do but what do we do to get there? So one of the first things that you need to do when you get ready to design a program is to create an algorithm. An algorithm is a set of logical steps that must be taken to perform a tasks.
So that's the glossary term, let's say in English. So what is your program supposed to do? Let's write down and list of things that we have to meet in that program in order to, for it to run properly. That's an algorithm, we're getting a list of things that we have to do. So here's a little sample, say we just write a very small program that does very few things and prints I am awesome, however many number of times if the user puts something in. So what do we have to do first?
Well, first, we're gonna have to get the username. And then we need to ask the user to enter a random number. And then we're going to print, I'm awesome, that random number of times. Those are the lists of things that we need in order to start that program. So we're going to get user name, then we have to look at our programming language and see how we do that. We syntax, the rules in the language that we're going to use.
I hope that makes sense. Because if we don't have a list of requirements or list of things that we must include in our program, it's going to cause us to have more logical errors. If you think about it, when you get up in the morning, what is the first thing that you do? I asked my students this all the time. And always the first thing I get is we get out of bed. I'm like, do you really do really get out of bed?
Because what's the first thing that happens for most people? And their thinking and their thinking? And then I asked them, Do you set an alarm clock the night before? And they say yes, yes, our alarm clock goes off. Okay. So the first thing that happens in the morning that you know of your alarm clock goes off, then what do you do?
Well, I'll get some different answers with that one. I haven't heard anybody say I throw the clock across the room yet but I've heard some people's Clap it hit it, all kinds of things. So whatever it is that you do, you could consider that a statement within your program, something happens. And then what is the condition? So if the alarm clock is going off, then that prompts us to do something, right. So if we have a condition is going to prompt us to do something.
So that's what I'm talking about. When I say we have to get that list, we have to get that logical order because we can't mean we might wake up before the alarm goes off, but then we're still going to have to go back and turn that alarm off, or it's going to go off later. I mean, so we have to think about our logical order of things. If we are printing paychecks for our employees, we can't just print out whatever we have to make sure that we know what was their gross pay, right. And we have to do some calculations to figure out what their gross pay was. I mean, if they are an hourly employee, how many hours did they leave work?
What They're ready to pay, do they get overtime and etc. So all of those things have to be done before you can print out a paycheck. And that's what's called the logical order. Another way that we can work on designing a program is writing pseudocode. pseudocode is like a fake code. And it has an informal language.
There's no syntax rules, like we have when we do our programming, where we have to put a semi colon or whatever rule it is that we have to do. We don't have any syntax rules with pseudocode. It's not meant to be compiled or execute executed. It's just used to create the model program. So basically, what we're doing is we're trying to write in logical order, all the things that have to happen in our program and how it's going to happen. So that gives us a list we know we put it in logical order.
Again, if you don't turn on your alarm clock at night, and then the alarm clock doesn't go The next morning, we might not wake up and you know, then we might be late for work or whatever is that we need to do that day. So pseudocode is a way of writing a fake code that makes us put it in logical order, so that we can pay close attention to everything and not do the wrong thing first. If you're a visual person, there's a chance that writing pseudocode may not be as visual as you like. flowcharts are another way that you can design. If you're a visual person, there's a chance that writing pseudocode may not be as visual as you like. flowcharts are another way that you can design a program and it's a diagram that graphically represents the steps in the program.
So it gives you an instant visual, you can actually See how the program flows. It has specific symbols that are for a specific reason. So ovals, for example, are symbols that can start and end in the program. parallelograms are input and output symbols. rectangles are processing symbols. There are a lot more symbols than that.
But to start you off, those are some very simple ones. The symbols are connected by arrows that represent the flow of the program. And so that way you can tell where the program starts, where the here's a very small sample flowchart, but an example it still is. We have our start and we have our n and you can see that those are clearly ovals. And then what is your name, get name that's an input. Enter a random number between one and 25 get number again That's another input and you see how the box or the oval or whatever shape that shape changes depending on the process that you expect it to do.
Absolutely fantastic visual can be way more complicated than what you're viewing here. But just get the idea right now that a sample flowchart has specific symbols for a specific function. And you can lay those out. And I'm going to talk to you a little bit later about a free program that I absolutely love to use when developing a flow chart. But I'm not going to tell you just yet because right now, we're still learning the concepts. And the other program though, I'm going to get you really excited already.
The other program, you can actually run it and see if there's any issues with your logic before you get started coding. So very, very cool. And we will talk about that later on. In a Resource Awesome man. Aren't you excited that you made it through another lesson already? Help ER and help you learn in a lot.
Remember the wonderful things about these videos is if you forget something, go back over and go listen to them again. I highly, highly recommend when you are learning program to spend some time to do that. repetition, repetition, repetition, hey, repetition is old school, but it is still a valid technique and it can still be used. And when you put it all together when you learn all those words, repetition and you might know the glossary term and that's wonderful. But when you start doing hands on it's really going to start clicking if you have both. So please make sure you do some repetition and learn that stuff.
I'm so excited you completed Lesson six. On to the next lesson.