![Page 1: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/1.jpg)
Computers:Tools for an Information Age
Chapter 15Programming and Languages:Telling the Computer What to Do
![Page 2: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/2.jpg)
2
Objectives
Describe what programmers do and do not doExplain how programmers define a problem, plan the solution, and then code, test, and document the programList and describe the levels of programming languages: machine, assembly, high level, very high level, and naturalDescribe the major programming languages that are in use todayExplain the concepts of object-oriented programming
![Page 3: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/3.jpg)
3
Programming
Program – a set of detailed, step-by-step instructions that directs the computer to do what you want it to doProgramming language – a set of rules that provides a way of telling the computer what operations to perform
![Page 4: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/4.jpg)
4
The Programming Process
Five main steps Defining the problem Planning the solution Coding the program Testing the program Documenting the program
![Page 5: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/5.jpg)
12
Levels of Languages
Lower-level languages – more like the 0s and 1s the computer itself usesHigher-level languages – more like the languages people useDivided into five generations
![Page 6: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/6.jpg)
13
Five Generations of Languages
Machine languageAssembly languagesHigh-level languagesVery high-level languagesNatural languages
![Page 7: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/7.jpg)
19
Major Programming Languages
FORTRANCOBOLBASICRPGVisual BasicCJava
![Page 8: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/8.jpg)
27
Object-Oriented Programming
Object – a self-contained unit that contains both data and its related functionsKey terms in object-oriented programming Encapsulation – an object isolates both its data
and its related instructions Attributes – facts that describe the object
Also called properties Methods – instructions that tell the object to do
something Messages – an outside stimulus that results in
the change of the state of an object
![Page 9: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/9.jpg)
28
Using ObjectsProgrammers define classes of objects
The class contains all attributes that are unique to objects of that class
An object is an instance (occurrence) of a class
Objects are arranged hierarchically in classes and subclasses
Subclasses are derived from classes
Inheritance – a subclass possesses all attributes of the class from which it is derived
Additional attributes can be coded in the subclasses
![Page 10: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/10.jpg)
29
Activating the Object
A message is sent to the object, telling it to do something The object’s methods tell it how to do it
Polymorphism – each object has its own way to process the message For example, the class may have a
Move method, but each subclass implements that method differently
![Page 11: Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do](https://reader036.vdocuments.us/reader036/viewer/2022082610/56649d4e5503460f94a2d859/html5/thumbnails/11.jpg)
30
Object-Oriented Languages
C++JavaC#Visual Basic