How Do We Communicate With Computers?

13 slides
0.24 MB

Similar Presentations

Presentation Transcript


Agenda1. 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




Lets Consider The Following Scenario 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!?


Continuing With The AnalogyWhat 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?


Continuing With The AnalogyWhat 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 AnalogyWho 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?


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.


TerminologyBinaryHigh-Level LanguageLow-Level LanguageA 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.


TerminologySyntaxSemanticsRefers 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 funRefers 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.


TerminologyDebuggingWhen 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.CompilerA device capable of translating a program written in a high-level language (Java) into machine language (binary) so that it can be executed. Source FileA text file that contains your program that was written in a high-level language such as Java or C++.


Source FileCompilerExecutableThe 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

Browse More Presentations

Last Updated: 8th March 2018

Recommended PPTs