Table of Contents Date(s) Title/Topic Page #s 8/31 1.4 Programming Languages 26-27

Set up p. 26 for HW and p. 27 for Cornell notes HW 1.4 Programming Languages

26 27 p. 27 1.4 Programming Languages Language machine language binary Levels mnemonics l English-like leve high-level language ow- phrases l fourth-generation language or 4GL Programming Languages A program must be translated into machine language before it can be executed on a particular type of CPU This can be accomplished in several ways A compiler is a software tool which translates source code into a specific target language Often, that target language is the machine language for a particular CPU type The approach is somewhat different

Java Translation The Java compiler translates Java source code into a special representation called bytecode Java bytecode is not the machine language for any traditional CPU Another software tool, called an interpreter , translates bytecode into machine language and executes it Therefore the Java compiler is not tied to any particular machine Java is considered to be architecture-neutral the Java compiler and interpreter are part of the Java Development Kit (JDK) p. 27 1.4 Programming Languages a software tool which compiler translates source code into a specific target language

a software tool which translates interpreter bytecode into machine language and executes it Development Environments There are many environments for developing Java software: > Sun Java Development Kit (JDK) > Sun NetBeans > Borland JBuilder > CodeWarrior > Microsoft Visual J++ > IBM > Monash BlueJ > Dr. Java > Jurtle Though the details of these environments differ, the compilation and execution process is essentially the same p. 27 1.4 Programming Languages syntax how we can put together symbols, reserved words, and identifiers to make a valid program

semantics what that statement means (its purpose or role in a program)

Syntax and Semantics A program that is syntactically correct is not necessarily logically (semantically) correct A program will always do what we tell it to do, not what we meant to tell it to do p. 27 1.4 Programming Languages compile-time error errors runtime error logical error

A program can have three types of errors The compiler will find syntax errors and other basic problems ( compile-time errors ) > If compile-time errors exist, an executable version of the program is not created A problem can occur during program execution, such as trying to divide by zero, which causes a program to terminate abnormally ( run-time errors ) A program may run, but produce incorrect results, perhaps using an incorrect formula (logical errors ) Summary - at bottom of p. 27 What is the difference between high- level language and machine language? HW - Mult choice 1.6-1.8 on p. 45-46 and True/False 1.1-1.10 on p. 46 do on p. 26 in NB