Agenda - PowerPoint PPT Presentation

About This Presentation
Title:

Agenda

Description:

Title: How Do We Communicate With Computers? Author: Valued Gateway Client Last modified by: Valued Gateway Client Created Date: 10/12/2003 6:46:17 PM – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 14
Provided by: ValuedGate1670
Category:

less

Transcript and Presenter's Notes

Title: Agenda


1
Agenda
1. PowerPoint presentation on the process of
programming (emphasis on terminology).
2. Assignment 1 (to be handed in by the end of
the class)
2
The Process of Programming.
Created By Information Technology Teacher Mr.
Zamar
3
Ronaldo
Lorenzo
4
Lets Consider The Following Scenario
  • An Italian chef Lorenzo wants to help his
    Brazilian friend Ronaldo bake a soccer ball cake
    for his sons birthday. The Italian, being an
    experienced chef, wrote this difficult recipe
    very carefully. The plan is to have the chef
    dictate the steps to Ronaldo, who will be doing
    the actual cooking. Heres the catch Ronaldo
    cant speak Italian and, you guessed it, Lorenzo
    never learned to speak Portuguese. What has to
    happen so that Lorenzo is able to help Ronaldo
    bake this cake!?

5
Continuing With The Analogy
  • What played the role of the program?

The recipe.
Why?
A program is defined as a set of instructions.
From this definition we may view the recipe as a
program. In this case the program was a set of
instructions for making a soccer ball cake.
6
Continuing With The Analogy
  • What played the role of the programmer?

Lorenzo, the Italian chef.
Why?
A programmer can be defined as someone who
prepares a set of instructions to be carried out
by something or someone. In this case Lorenzo
wrote the soccer ball cake recipe so we may
view him as the programmer.
7
Continuing With The Analogy
  • Who played the role of the computer?

Ronaldo.
Why?
A computer can be defined as a device capable of
carrying out a logical set of instructions. In
this case, Ronaldo was the one doing the actual
cooking so we may view him as the computer.
8
What Is The Purpose Behind This Analogy?
  • The problem we observed between the Brazilian
    chef and the Italian apprentice can also be seen
    between people and computers. How So?

Computers do not understand languages such as
(C, Java) and people do not understand machine
language (binary). So how do we communicate with
computers then?
We use something called a compiler. Compilers
translate programs written in languages such as
Java into binary (a language of ones and zeros).
Once our program is translated into binary a
computer can execute it. A computer cannot
execute Java code directly.
9
Terminology
Binary
A language that consists of only ones and zeros.
Computers only understand instructions written in
binary.
High-Level Language
A programming language that resembles English
more than it does binary. Java and C are good
examples of high-level programming languages.
Low-Level Language
A programming language that resembles binary more
than it does English. Very difficult for humans
to understand.
10
Terminology
Syntax
Refers to the spelling and grammar rules of a
programming language. Here are 2 examples (using
English) of syntax errors Mr. Zamar cant
spel. Snowboarding can be a lot of fun
Semantics
Refers to the actual meaning of your programming
statements. Heres an example (using plain
English) that illustrates the concept of a
semantic error Noiseless blue sounds sit
cross-legged under the mountaintop.
11
Terminology
Source File
A text file that contains your program that was
written in a high-level language such as Java or
C.
Debugging
When the compiler finds error(s) in your source
file you have you go back and fix the error(s)
before compiling again. The act of fixing your
error(s) is called debugging.
Compiler
A device capable of translating a program written
in a high-level language (Java) into machine
language (binary) so that it can be executed.
12
A runtime error occurred. These errors are caused
by semantic errors in your program. Your program
will need to be debugged.
Source File
Compiler
Executable
The compiler caught a syntax or semantic error.
You need to go back and debug your program.
Success! Program runs with no errors.
13
Can computers be made to understand English?
Some Other Important Questions
  • No. Computers can only understand binary (Zeros
    and Ones ? 110101001101110111)

Why cant we program in English and then
translate it into binary?
  • English is to imprecise for computers. In fact,
    many people argue its to imprecise for humans
    even!
  • Its common for two different people to have two
    different interpretations of the same English
    statement. Mapping these statements into computer
    instructions is impossible.
Write a Comment
User Comments (0)
About PowerShow.com