Designing a Program

Introduction to Programming Input, Process, Output
12 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€65.43
List Price:  €93.47
You save:  €28.04
£55.38
List Price:  £79.12
You save:  £23.73
CA$95.75
List Price:  CA$136.80
You save:  CA$41.04
A$107.11
List Price:  A$153.03
You save:  A$45.91
S$95.36
List Price:  S$136.24
You save:  S$40.87
HK$547.90
List Price:  HK$782.75
You save:  HK$234.85
CHF 63.27
List Price:  CHF 90.39
You save:  CHF 27.12
NOK kr772.60
List Price:  NOK kr1,103.76
You save:  NOK kr331.16
DKK kr487.88
List Price:  DKK kr697.01
You save:  DKK kr209.12
NZ$117.84
List Price:  NZ$168.36
You save:  NZ$50.51
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,700.43
List Price:  ৳11,001.09
You save:  ৳3,300.65
₹5,837.33
List Price:  ₹8,339.41
You save:  ₹2,502.07
RM333.67
List Price:  RM476.70
You save:  RM143.02
₦92,489.99
List Price:  ₦132,134.22
You save:  ₦39,644.23
₨19,533.24
List Price:  ₨27,905.82
You save:  ₨8,372.58
฿2,588.46
List Price:  ฿3,697.97
You save:  ฿1,109.50
₺2,275.23
List Price:  ₺3,250.47
You save:  ₺975.23
B$358.08
List Price:  B$511.57
You save:  B$153.48
R1,314.42
List Price:  R1,877.82
You save:  R563.40
Лв127.95
List Price:  Лв182.79
You save:  Лв54.84
₩96,452.39
List Price:  ₩137,795.03
You save:  ₩41,342.64
₪267.23
List Price:  ₪381.78
You save:  ₪114.54
₱4,034.64
List Price:  ₱5,764.02
You save:  ₱1,729.38
¥11,065.06
List Price:  ¥15,807.91
You save:  ¥4,742.85
MX$1,201.03
List Price:  MX$1,715.83
You save:  MX$514.80
QR255.83
List Price:  QR365.49
You save:  QR109.65
P965.79
List Price:  P1,379.76
You save:  P413.97
KSh9,296.24
List Price:  KSh13,280.92
You save:  KSh3,984.67
E£3,349.82
List Price:  E£4,785.67
You save:  E£1,435.84
ብር4,026.64
List Price:  ብር5,752.60
You save:  ብር1,725.95
Kz58,375.85
List Price:  Kz83,397.65
You save:  Kz25,021.80
CLP$66,628.33
List Price:  CLP$95,187.41
You save:  CLP$28,559.08
CN¥507.11
List Price:  CN¥724.48
You save:  CN¥217.36
RD$4,113.13
List Price:  RD$5,876.15
You save:  RD$1,763.02
DA9,393.54
List Price:  DA13,419.92
You save:  DA4,026.38
FJ$158.35
List Price:  FJ$226.22
You save:  FJ$67.87
Q545.71
List Price:  Q779.62
You save:  Q233.91
GY$14,678.83
List Price:  GY$20,970.66
You save:  GY$6,291.82
ISK kr9,808.34
List Price:  ISK kr14,012.52
You save:  ISK kr4,204.17
DH708.72
List Price:  DH1,012.51
You save:  DH303.78
L1,243.72
List Price:  L1,776.81
You save:  L533.09
ден4,025.16
List Price:  ден5,750.48
You save:  ден1,725.31
MOP$565.76
List Price:  MOP$808.27
You save:  MOP$242.50
N$1,323.80
List Price:  N$1,891.23
You save:  N$567.42
C$2,582.07
List Price:  C$3,688.83
You save:  C$1,106.76
रु9,353.99
List Price:  रु13,363.42
You save:  रु4,009.42
S/263.57
List Price:  S/376.55
You save:  S/112.97
K270.82
List Price:  K386.91
You save:  K116.08
SAR262.49
List Price:  SAR375
You save:  SAR112.51
ZK1,859.31
List Price:  ZK2,656.27
You save:  ZK796.96
L325.94
List Price:  L465.65
You save:  L139.71
Kč1,644.39
List Price:  Kč2,349.23
You save:  Kč704.84
Ft25,663.75
List Price:  Ft36,664.08
You save:  Ft11,000.32
SEK kr762.14
List Price:  SEK kr1,088.81
You save:  SEK kr326.67
ARS$61,304.48
List Price:  ARS$87,581.58
You save:  ARS$26,277.10
Bs486.59
List Price:  Bs695.16
You save:  Bs208.56
COP$277,527.04
List Price:  COP$396,484.19
You save:  COP$118,957.15
₡35,650.64
List Price:  ₡50,931.67
You save:  ₡15,281.02
L1,732.56
List Price:  L2,475.19
You save:  L742.63
₲522,432.19
List Price:  ₲746,363.69
You save:  ₲223,931.50
$U2,704.33
List Price:  $U3,863.50
You save:  $U1,159.16
zł282.07
List Price:  zł402.98
You save:  zł120.90
Already have an account? Log In

Transcript

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.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.