CompTIA IT Fundamentals FC0-U61 – Developing and Implementing Software

  1. Introduction to Programming

You have hardware, the stuff you can kick, the physical part that handle processing. You have the operating system like Windows or Android, that enables people to interact with the hardware, to tell the hardware what to do. And finally, you have programs or apps, things dedicated to accomplishing specific tasks. The CompTIA It Fundamentals plus exam expects you to have a certain level level of knowledge about how programs work. This episode starts that process. What’s the most common computing device? A smartphone. Right. What can you do with a smartphone? Make phone calls? Sure. Send text messages? We could do that with the ancient Flip phones, too.

Beyond those basic functions, though, a smartphone has apps to do more, such as take pictures, view pictures, record sounds, or play games. Each of those activities is a program or app, a specific task that the computer enables you to do. People who write programs called programmers conveniently have to use a series of commands that the computer understands. But computers are dumb. They understand basic math like adding subtracting, multiplying, and dividing. And the language they get is called machine language, basically a bunch of ones and zeros.

But humans don’t speak or write machine language, so we use programming languages to translate what we want the computer to do into something that the computer understands. Programming languages come in a variety of forms. One of the most basic, called assembly, is about the closest we can get to machine code. Programmers can and still do use assembly to write programs and apps to enable the computer to do tasks. Here are sample lines of assembly, and that I’d get. The answer five, because I just added two plus three. Even in the early days of computers, people realized that a lot of code they wrote within a program repeated or followed similar patterns.

Wouldn’t it make sense to have a special code phrase or function to run a series of commands? Plus wouldn’t it be better to have the code more readable? You could take lines of assembly code, for example, and replace them with one line of special code that’s more English or easier to write. Here’s an example, and the answer again, is five. The key tool for making these more complex languages work is a program called a compiler. Programmers write using a higher level programming language and then run the code through a compiler to create an application that the computing device understands. These higher level programming languages are called compiled languages.

You might have heard of some of them, such as Java or C Plus Plus. As an aside, there are other types of programming languages out there. You saw a query language back in chapter 14 when we talked about databases, right? Structured query language, or SQL, enables you to run queries on a relational database. As the name would suggest, it’s a query language. You also run into interpreted programming languages all the time. In typical computing, like every time you open a web browser and surf the Internet. Your computer interacts with languages such as JavaScript to make cool things happen in your browser. Modern programmers use high level programming languages to create amazing apps that enhance productivity, enable creativity, and make you smile.

  1. Programming with a PBJ Sandwich

Real computer programming code can look pretty cryptic. To get us started programming, I want to bring it to the mundane. So let’s make a peanut butter and jelly sandwich. Really? When programmers sit down to write an app, they need first to figure out what they want to accomplish. So start with a simple flowchart. The goal is to create a peanut butter and jelly sandwich. You have bread, peanut butter and jelly. Combine these three ingredients to get the end result and then we eat the sandwich. Yum. Once you’ve created a flowchart, it’s time to work through the step by step process in English. To make sure you know how the app will work. You can translate those steps into programming as another step later. Building this initial step by step process is called writing in pseudocode. It’s very common in application development.

Pseudocode helps in a couple of ways. It provides a roadmap that other programmers can follow. This is essential in a team environment. For example, with ten different programmers working on a single app, they need to know what every other programmer is trying to accomplish. Second, and very important, computers are dumb, or at least extremely literal. Pseudocode helps make the discrete steps in a program logical. Cool. Let’s make a peanut butter and jelly sandwich. I asked a group of my students to write in pseudocode a program for making a peanut butter and jelly sandwich. First, we assembled the supplies. You can think of each type as an object bread, peanut butter, jelly, knife, spoon, plate. For simplicity’s sake, we’ll make some of these objects constants, meaning they won’t change. For this exercise, a knife is a knife, a spoon is a spoon. Other objects might differ or vary, if you will. What type of bread do you eat?

White bread, whole wheat, some fancy artisan style. The bread object has variations. Thus you can think about it as a variable. The same for peanut butter, creamy or crunchy. And the jelly grape, plum, orange, marmalade and so on. To make it super easy for my students, we went with six constants. The bread is fancy, artisan style. The peanut butter is creamy. The jelly is plum. The knife, spoon and plate are just what they are. Each student used index cards to list in pseudocode the steps for making a sandwich. So let’s see how they did. I’m the computer. Does this shirt make me look robotic? The first student up is James. Here are his steps. Put the bread on the plates. Open the peanut butter. Put the peanut butter on the bread. This is not going to end well. Let’s try. Student number two. Martha’s program starts with more detail. Open the bread. Remove two slices.

Place the slices on the plate. Open the peanut butter. Spread the peanut butter on the bread. Open the jelly. This is getting messy. Martha obviously skipped a step or two. Student number three, Andre, offers better detail. Open the bread. Remove two slices. Place slices on the plate. If the peanut butter is closed, open it and proceed to step six. Pick up the knife. Dip the knife in the peanut butter. Spread the peanut butter on one slice of bread. Now that’s a little more like it. Andre made very specific steps, leaving nothing to chance. Because computers don’t do chance at all. They only do literally what they’re told to do. Andre also included conditional statements.

Those are the if statements in his program. Sweet. We can tack a couple more concepts on the PB and J analogy or program. Say, for example, the exercise called for making several sandwiches, enough to feed the class. You might want to go to an assembly line to make the process more efficient. This assembly line could use a programming concept called looping. For example, get a plate, get two slices of bread, put bread on plate, then repeat this process seven times. In other words, make a loop. Do it again. Likewise, if we had a variety of sandwiches to make, the program could use branching. For example, the app is make a sandwich.

But we have ingredients to make PB and J, bologna and cheese and tuna salad. The basic process is the same make a sandwich. But early in that process, right after putting bread on a plate, you would see options. If making a PB and J, go to option one. If making a bologna cheese, go to option two. If making tuna salad, go to option three. Each of these options is a branch. Let me drop the sandwich making analogy for a moment and focus on some of the programming terms.

An object is a construct that combines data and behavior. A file on your desktop is an object. For example, you can right click and select Properties. You can do things to the file, such as copy or move. It a constant often refers to something that won’t change, such as the number pi, a variable you’ll remember from math and school. In the equation on the screen, x and y are the variables. They change according to the value in each one. Finally, when you create specific steps in a program using proper programming language, you develop an algorithm. That algorithm includes conditional statements, step by step procedures, and more. The peanut butter and jelly program analogy helps make programming more understandable in a few ways. Use a flowchart for the big development picture. Use pseudocode to make the steps easy to follow. Go through the process to test your logic and how the computer will respond. And the best part you get a delicious sandwich to eat at the end.

  1. AMA – Ask Me Anything about Programming

Hey, Shannon. Wow, chapter 15 already. Yes, I’m almost there. Whoa. Yay. Few quick questions for you on this chapter. Okay? Let’s talk about arrays and vectors. Okay? An array is is is a data structure of kind of a fixed size. Okay? Let me give you, let me give you an analogy. Imagine you have a deli, right? And there’s a glass case in front of the cash register. And in that case, there are five spots for five plates with sandwiches only, okay? So the plates are always there. You can have five sandwiches, you can have four, none, it doesn’t matter. But there’s always space for five.

That’s an array. It’s a fixed sized thing, right? A vector, on the other hand, imagine the other deli case that’s empty, and you can set it up so that you can put two plates in there or take those out and put one plate in there with sandwiches or three plates in it’s. Variable, right? So the difference, right, between an array and a vector is of an array gives you a fixed size of the same kind of component, and a vector gives you a changeable set of things.

Okay, so then how does that have to do with programming? Okay? Makes me hungry. But so in programming an array, you would set aside an array like, say, a sequential set of numbers, like five one through five, right? And that set of numbers is always going to be there for you to use in your programming. With a vector, on the other hand, you also set aside a space, but it’s a variable size. You can shrink those numbers.

So instead of having five, you can say, I only want three for this particular piece of code. Just like with the sandwich cases, though, an array is going to be snappier because it’s a fixed size than a vector. So that’s how it works in programming. So if it’s flexible, it takes more time. Exactly. Got it. So in terms of programming, what is a function? A function is what you can do with something. Let me give you an example. A file on your desktop, you can right click it and get two properties, right? Like what kind of security is applied to that file, whether it’s hidden or read only. You can also do things to that file, right? You can move the file, you can copy, you can delete the file. What you’re doing to that file are functions. Okay, that makes sense. Last question. Okay. What kind of language is HTML? HTML hypertext markup language. It’s a markup language.

We use this for taking text files, marking them up, so that your web browser can interpret that marking as how the page is going to lay out and how it’s going to look, whether it’s bold, et cetera. On the exam, you would see this as an interpreted language, even though most of us talk about it as just a markup language. But you’d see it as an interpreted language, although in the real world, you’ll see more scripting languages like JavaScript as being interpreted languages. So HTML markup may be interpreted on an exam near you. All right. That’s all I’ve got for this time. Thank you so much, Scott. That’s so awesome. I’m ready to take my exam. Good luck.