Object Oriented Programming Using C An Introduction 1st Edition by Pardoe, King 0333692411 978-0333692417 pdf download
Object Oriented Programming Using C An Introduction 1st Edition by Pardoe, King 0333692411 978-0333692417 pdf download
_____ Follow the link below to get your download now _____
https://ebookball.com/product/object-oriented-programming-
using-c-an-introduction-1st-edition-by-pardoe-
king-0333692411-978-0333692417-15282/
https://ebookball.com/product/object-oriented-programming-using-c-1st-
edition-by-simon-kendal-9788776818142-15260/
https://ebookball.com/product/c-programming-an-object-oriented-
approach-1st-edition-by-behrouz-forouzan-richard-
gilberg-0073523380-9780073523385-15328/
Object Oriented Programming C Simplified 1st Edition by
Hari Mohan Pandey 978-9381159507
https://ebookball.com/product/object-oriented-programming-c-
simplified-1st-edition-by-hari-mohan-pandey-978-9381159507-15298/
https://ebookball.com/product/an-introduction-to-object-oriented-
programming-with-java-5th-edition-by-thomas-
wu-0073523305-9780073523309-17244/
https://ebookball.com/product/an-introduction-to-object-oriented-
programming-with-java-5th-edition-by-thomas-
wu-0073523305-9780073523309-15256/
https://ebookball.com/product/an-introduction-to-object-oriented-
programming-with-java-5th-edition-by-thomas-
wu-0073523305-9780073523309-15330/
10987654321
06 05 04 03 02 01 00 99 98 97
Contents
Preface ix
1 Programming Concepts 1
1.1 Computer programs 1
1.2 The way a program uses the computer's memory 2
1.3 Input and output of data 4
1.4 Computer program development 6
1.5 The user requirements specification 6
1.6 The design stages 7
1.7 Detailed design using pseudo-code 7
1.8 The programming stage 8
1.9 Compiling, running and testing a program 8
1. 10 Documenting and maintaining pro grams 9
1.11 Writing high-quality computer programs 10
1.12 Exercises 10
3 A First Program 21
3.1 The model for our first program 21
3.2 The C++ code for our first program 22
3.3 Coding style 26
3.4 Pseudo-code for a sequence 27
3.5 Exercises 28
v
vi Contents
4 An Introduction to Inheritance 29
4.1 Using a header file 29
4.2 Inheriting code from our first program into a second
program 31
4.3 Exercises 34
5 Arithmetic 36
5.1 Integers 36
5.2 Assignment statements and integer arithmetic 37
5.3 Real arithmetic 38
5.4 A model for a student's assessment in a subject 38
5.5 Using integer and real numbers, the ini tialise
function 42
5.6 The display functions 44
5.7 Exercises 46
6 An Introduction to Selection 49
6.1 Further development of a model for a student's
assessment in a subject 49
6.2 The i f statement 49
6.3 The if-else statement 52
6.4 Relational operators 53
6.5 Nested selections 54
6.6 Compound statements 56
6.7 Exercises 57
8 Repetition 74
8.1 Refining the input processes for the student's marks 74
8.2 The whi le statement 77
8.3 The for statement 80
8.4 The do-while statement 82
8.5 Exercises 85
9 Functions 88
9.1 The function call 88
9.2 The function definition 89
9.3 A revised version of the student marks object class 90
9.4 Call by value parameters 91
9.5 Function results 93
9.6 Call by reference parameters 96
9.7 When to use call by value and call by reference 101
9.8 Exercises 101
Index 249
Preface
ix
x Preface
Chapter I covers basic concepts in order that the reader can appreciate what
a computer program is. The development of a program is then put in context by
describing briefly, in general terms, the various stages involved. Chapter 2
introduces the basic object oriented terminology and illustrates how object classes
are used to model a very simple system.
Having introduced a C++ program in chapter 3, the important concept of
inheritance and the use of a header file are covered in chapter 4.
Chapters 5 to 8 cover, within an object oriented context, facilities found in
most procedural languages, such as basic data types, arithmetic and control
constructs for selection and repetition. The need for, and the difference between,
the constructs for both selection and repetition are emphasised.
Chapter 9 concentrates on the use of programmer-defined functions; con-
cepts are introduced by referring to functions already used including those found
in standard C++ libraries. The next chapter on the use of constructors and
destructors is a natural development.
The need for arrays and their use is described in chapters 11 to 13. The
concept of an array of objects enables the difference between inheritance and
aggregation to be explained.
Scope rules and object lifetime are emphasised in chapter 14 before introduc-
ing the concept of pointers for dynamic variables and objects. Then chapter 15
covers the use of file streams in general and how they may be used to facilitate
object persistence.
Finally, in chapter 16, we introduce some of the fundamental concepts of
polymorphism and use appropriate C++ language constructs in straightforward
illustrative examples.
Acknowledgement
The authors are grateful to Neil Hepworth of South Bank University for his
helpful and constructive comments made while reviewing this book.
1 Programming Concepts
1
2 Object Oriented Programming Using C++
Fahrenheit and convert them to degrees Celsius. A more complex program for a
company's payroll system would take in a great deal of data, staff names, tax
codes, salary grades and so on, in order to produce results in the form of
payshps and cheques or bank credits. The values that the program takes in are
known generally as the input data and the results are often referred to as the
output. This can be visualised as in figure 1.1.
..
Program
....
held in memory
Data values manipulates data r- Results
stored in memory
Figure 1.1
to its right as byte 01 and the one directly beneath it as byte 10, and so on.
9 I I
Figure 1.2
computer memory
constant value !!
computer memory
program statement
a_letter = 'B' ;
computer memory
Identifier a_letter
Figure 1.3
In this diagram, we have three areas of computer memory. At the top we
have a single byte that is of data type character and it contains the constant
Other documents randomly have
different content
operieren versuche. Trotz seines Befehles ging er also mit 22
Linienschiffen am 25. August nach Savannah in See.
Hiermit fanden die größeren Ereignisse in Westindien für 1779 ihr
Ende. B y r o n segelte im August nach England; B a r r i n g t o n, bei
Grenada verwundet, war schon früher heimgekehrt.
K o n t r e a d m i r a l H y d e P a r k e r übernahm das Kommando der
Antillenstation bis zum März 1780; dann traf Admiral R o d n e y mit
einer Flotte ein und der Kampf auf diesem Kriegsschauplatze begann
wieder.
Einige kleinere Ereignisse in Westindien sind noch zu erwähnen. Schon im
September 1778 hatten sich die Franzosen von Cap Français aus der
nahegelegenen kleinen T u r k - I n s e l n bemächtigt, die von Engländern besiedelt
waren. — Durch die Abfahrt d ' E s t a i n g s erlangten diese die Überlegenheit und
behielten sie auch, als im November und Dezember ein Teil der französischen
Flotte von Savannah zurückkehrte. H y d e P a r k e r verfügte in Sta. Lucia über
etwa 17 Linienschiffe, während d e L a M o t t e - P i c q u e t Mitte Dezember in
Martinique nur 6 oder 7 hatte, von denen sogar einige zeitweise außer Dienst
gestellt waren. Hyde Parker überwachte Fort Royal, und es gelang ihm, am 18.
Dezember vor diesem Hafen einen Konvoi von 26 Transportern und
Handelsschiffen zu überraschen und auseinander zu sprengen, der im Oktober mit
nur einer Fregatte von Marseille gesegelt war. Er würde alle Fahrzeuge genommen
oder vernichtet haben, wenn ihm nicht L a M o t t e mit drei in aller Eile seeklar
gemachten Linienschiffen kühn entgegengetreten wäre. Durch einen vierstündigen
K a m p f i n d e r B u c h t v o n F o r t R o y a l, in den auch die Befestigungen
eingriffen, ermöglichte dieser 12 Fahrzeugen das Einlaufen, 10 wurden vom Feinde
genommen, vier gerieten auf den Strand und wurden verbrannt, doch hatte man
die Ladungen retten können. — Am 21. Dezember nahm Admiral R o w l e y mit
einer Division Linienschiffe bei G u a d e l o u p e drei französische Fregatten, die mit
Truppen von Savannah zurückkamen.
Spanien hatte durch Entsendung von zwei Geschwadern zu 6 und 10
Linienschiffen nebst Transportern mit Truppen und Kriegsmaterial im Februar und
März 1779 die Stationen in Westindien schon vor der Kriegserklärung verstärkt.
Wenige Tage nach dieser begann von Portoriko, Kuba und dem Festlande aus der
Kleine Krieg; die Befehle hierzu müssen also schon längere Zeit vorher ergangen
sein. Ihm trat A d m i r a l S i r P e t e r P a r k e r von Jamaika aus entgegen,
obgleich er nur ein Linienschiff, ein 50-Kanonenschiff und 8 Fregatten oder Sloops
zur Verfügung hatte. Er ließ sogar im Oktober den stark befestigten Ort O m o a an
der Hondurasküste, einen Stützpunkt der Spanier für den Kleinen Krieg, nehmen;
zwei Silbergaleonen und verschiedene Kauffahrer mit einem Gesamtwert von drei
Millionen Dollars wurden dabei erbeutet. Die Spanier bemächtigten sich dagegen
der englischen Handelsniederlassungen am Mississippi.
(Näheres über diese kleineren Ereignisse vgl. Campbell Band V, Seite 453, 503,
514; Chevalier II, Seite 155; Lacour II, Seite 326.)
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookball.com