Computers Are Your Future: © 2005 Prentice Hall, Inc
Computers Are Your Future: © 2005 Prentice Hall, Inc
Slide 3
Slide 4
Programming Languages
Machine Language Fortran COBOL Visual Basic Smalltalk BASIC C and C++ Assembly Language Pascal Ada Java
9 Programming languages are artificial languages created to tell the computer what to do 9 They consist of vocabulary and a set of rules to write programs 9 The program development life cycle (PDLC) is an organized method of software development
2005 Prentice Hall, Inc. Slide 5
First-Generation Languages
9 Machine language:
Consists of binary numbers (0s and 1s) Is the earliest programming language Is the only language the computer understands without translation Is machine dependent
Each family of processors has its own machine language
2005 Prentice Hall, Inc. Slide 7
Second-Generation Languages
9 Assembly language:
Resembles machine language Is a low-level language Uses brief abbreviations for
program instructions.
Abbreviations are called
Third-Generation Languages
9 Procedural languages:
Are high-level languages that tell the computer what to do and how to do it Create programs at a high level of abstraction Are easier to read, write, and maintain than machine and assembly languages Use a compiler or interpreter to translate code
Slide 9
9 A compiler is a program that changes source code to object code 9 An interpreter translates source code one line at a time and executes the instruction
2005 Prentice Hall, Inc. Slide 10
Slide 11
Slide 12
Slide 13
Fourth-Generation Languages
9 Types of fourth-generation languages include:
Report generators
Languages for printing database reports
Query languages
Languages for getting information out of databases
Slide 14
Object-Oriented Programming
9 Object-oriented programming (OOP):
Relies on component reusability
The ability to produce program modules that perform a
specific task.
Eliminates the distinction between programs and data Uses objects that contain data and procedures
Slide 15
Objects
9 Objects are units of information that contain data as well as methods that process and manipulate the data 9 Classes of objects:
Hierarchy or category of objects Objects at the top of the category are broader in scope than the subclass objects
Slide 18
Ada
9 Ada:
Named after Augusta Ada Byron Incorporates modular programming The required language for the U.S. Defense Department Suitable for control of real-time systems (missiles) Sample Ada program
Slide 19
9 BASIC:
An easy-to-use language available on personal computers Widely taught in schools as a beginners programming language Designed as an interpreted language
2005 Prentice Hall, Inc. Slide 20
9 Visual Basic:
Is widely used in program development packages Uses event-driven programming Enables the programmer to develop an application by using on-screen graphical user interfaces
Slide 21
Pascal
Sample Pascal program
9 Pascal:
Is named after Blaise Pascal Encourages programmers to write well-structured programs Widely accepted as a teaching language Has been updated to reflect new approaches to programming
2005 Prentice Hall, Inc. Slide 22
C
9 C:
Sample C program Was developed by AT&Ts Bell Labs in the 1970s Combines highlevel programming Difficult to learn and language with programming is time assembly language consuming Programmers manipulate bits of data within a processing unit
2005 Prentice Hall, Inc. Slide 23
Smalltalk
Sample Smalltalk program
9 Smalltalk:
Developed in the 1970s by Xerox Corp 100% pure object-oriented programming language Not often chosen for software development
Slide 24
C++
9 C++:
Incorporates objectoriented features Is widely used for professional program development Sample C++ program
Slide 25
Java
9 Java:
Developed by Sun Microsystems An object-oriented, high-level programming language with a twist First true cross-platform programming language Gained acceptance faster than any other programming language A simplified version of C++
Slide 26
Java
9 Java, continued :
Java is designed to run on any computer platform Java Virtual Machine enables cross-platform use Java applets or small programs are downloaded to computers through networks Weaknesses include: The security risk in downloading applets The speed in running the programs
Slide 27
Slide 28
Web-Based Languages
9 Markup languages:
Hypertext markup language (HTML) sets the attributes of text and objects within a Web page Extensible markup language (XML) is used for sharing data and objects in a Web environment
9 Scripting languages:
VBScript is used to write short programs (scripts) that are embedded in Web pages JavaScript is used to write scripts on Web pages
Slide 31
9 Developing an algorithm is a step-by-step description of how to arrive at a solution 9 Program design tools:
Structure charts show the top-down design Flow charts show the logic of program Pseudo code alternative to flow charts
2005 Prentice Hall, Inc. Slide 32
Structured Design
9 Control structures are logical constructs that specify how the instructions in a program are to be executed 9 Three types of control structures:
Sequence control structure Instructions are executed in the order in which they appear Selection control structures The program branches to different instructions depending on whether a condition is met; IFTHENELSE Repetition control structure The program repeats the same instructions over and over; DO-WHILE and DOUNTIL
Slide 33
Slide 34
Slide 35
9 Testing and debugging eliminate all errors 9 Syntax and logic errors are corrected 9 Debugging is the process of eliminating errors
Slide 36
9 Documentation is created for future use 9 The variable names and definitions, a description of the files needed, and the layout of the output are produced 9 A user manual is developed to explain how the program works
Slide 37
Slide 38
Chapter 12 Summary
A programming language is an artificial language consisting of a vocabulary and a set of rules Machine language is the lowest-level programming language Assembly language contains symbols for programming instructions Third-generation (high-level) languages require programmers to specify the procedures to be followed Object-oriented languages combine procedures and data
Slide 39
Slide 40