Presentation on theme: "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)"— Presentation transcript:
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)
The Process of Programming. Created By Information Technology Teacher Mr. Zamar
An Italian chef Lorenzo wants to help his Brazilian friend Ronaldo bake a soccer ball cake for his son’s 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. Here’s the catch: Ronaldo can’t 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!? Lets Consider The Following Scenario
Continuing With The Analogy What played the role of the program? The recipe. 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. Why?
What played the role of the programmer? Lorenzo, the Italian chef. 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. Why? Continuing With The Analogy
Who played the role of the computer? Ronaldo. 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. Why? Continuing With The Analogy
The problem we observed between the Brazilian chef and the Italian apprentice can also be seen between people and computers. How So? What Is The Purpose Behind This Analogy? 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.
Terminology Binary High-Level Language Low-Level Language A language that consists of only ones and zeros. Computers only understand instructions written in binary. A programming language that resembles English more than it does binary. Java and C++ are good examples of high-level programming languages. A programming language that resembles binary more than it does English. Very difficult for humans to understand.
Terminology Syntax Semantics Refers to the spelling and grammar rules of a programming language. Here are 2 examples (using English) of syntax errors: Mr. Zamar can’t spel. Snowboarding can be a lot of fun Refers to the actual meaning of your programming statements. Here’s an example (using plain English) that illustrates the concept of a semantic error: Noiseless blue sounds sit cross-legged under the mountaintop.
Terminology 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. Source File A text file that contains your program that was written in a high-level language such as Java or C++.
Source FileCompilerExecutable The compiler caught a syntax or semantic error. You need to go back and debug your program. Success! Program runs with no errors. A runtime error occurred. These errors are caused by semantic errors in your program. Your program will need to be debugged.
Can computers be made to understand English? No. Computers can only understand binary (Zeros and Ones 110101001101110111) Why can’t we program in English and then translate it into binary? English is to imprecise for computers. In fact, many people argue it’s to imprecise for humans even! It’s common for two different people to have two different interpretations of the same English statement. Mapping these statements into computer instructions is impossible. Some Other Important Questions
Your consent to our cookies if you continue to use this website.