101. Computers DO NOT think for themselves. For them to do anything they need to be told what to...

15
COMPUTER PROGRAMMING 101

Transcript of 101. Computers DO NOT think for themselves. For them to do anything they need to be told what to...

Page 1: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

COMPUTER PROGRAMMING

101

Page 2: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

What is Computer Programming?

Computers DO NOT think for themselves. For them to do anything they need to be told what to do.

Simply put computer programming is when you tell a computer what you want it to do.

To do this you do one of three things: You write a program to tell the computer what to do You buy a program that someone else wrote that tells

the computer what to do You pay someone to write a program for you.

It’s really as simple as that.

Page 3: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

The Problem Your computer is has no brain.

I don’t mean that in an insulting way it’s just the truth. Your computer can do NOTHING without someone telling it EXACTLY what to do.

If you assume that your computer has intelligence it will disappoint you every time. You will be providing it with it’s intelligence and that is why you are programming it.

Page 4: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

The Basics At it’s heart computer programming is

nothing more than problem solving. To be successful as a programmer it is

important to take big problems and learn to break them down into a series of smaller problems.

Page 5: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Slow Down When writing a computer program we

have already discussed that it is about breaking big problems down into smaller more manageable chunks.

In order to do that you need to ALWAYS have an understand of WHAT YOU WANT TO ACCOMPLISH.

As you write code it is important to continuously ask yourself ‘What am I trying to accomplish?’

ALWAYS READ ALL INSTRUCTIONS!!!

Page 6: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Baby Steps… Once you know what you want the

computer to accomplish you then focus your attention on the next question. How can I program the computer to

accomplish this task? Let’s get a little practice with this: Get out one sheet of paper and please

give me instructions to get from here to Millenia Mall.

Page 7: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Baby Steps… Did anyone have anything that looks like

this? go to my car Drive from here to I4 Drive from the Princeton exit on I4 to the

Conroy exit Proceed along Conroy Road until you reach

the mall

Page 8: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Baby Steps… Can you see any potential problems with

those instructions? go to my car

What are the steps involved for me to go to my car?

Remember the computer can only do what you tell it to do and in many cases it CANNOT perform even simple tasks unless they are broken down into smaller steps.

Page 9: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Instructions Make sure you have your car keys If you don't have them then look around until you find

them. Once you find them put them in your pocket Make sure you have your wallet If you don't have your wallet look around until you find it.

Once you find it put it in your pocket. Walk towards the door Open the door Walk out the door Close the door If you are the last person to leave the house then lock the

door Walk towards your car Use your key to open the car Get into the car

Page 10: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Instructions The surprising thing about this activity is

that many of the previous instructions could be broken down into even more specific actions.

This is when you need to be both patient and determined.

Page 11: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Application Programs Most of you are familiar with things called

application programs (software). Applications programs are designed to

help the user perform specific tasks. Examples of application programs are:

Microsoft Word Google Chrome iTunes The camera app on your phone

Page 12: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Application Programs The basic process that any application

program follows is this: Get input Process that input Provide output Provide a way to Store (save) your work

Page 13: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Application Programs Create a table (a table is simply data that is stored in rows and columns)

that looks like this:

Program Name

Input Processing

Output

Microsoft Word

Google Chrome

iTunes

Camera app

Page 14: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Talking to the Computer When you communicate with people you

use a language that you both understand.

The trick is that the computer does not speak English.

To communicate with a computer you need to speak it’s language.

Stop

I can’t understan

d you

Page 15: 101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.

Talking to the Computer The language that you use when

communicating with a computer is called a ‘programming language’.

There are many programming languages out there and they all have a different style in which they talk to the computer.

The computer programming language that we will be using in this class is called ‘Scratch’.