PR211 (PP & OO C++), Block 4/2002
- by Dr Jan Pajak
In order to run any of these solution simply click
on the underlined part of the description of this problem!
- Read instructions at the end of this Web page.
- Click the button BACK (from the browser) to
return to the previous Web page.
The last update of the Web page on: 23 July 2005.
2003 - PR611
2003 Theory Content
Theory content of this course is based on the following textbook
[1] Deitel and Deitel: C++ How to Program, 4th Edition, Prentice Hall, ISBN 0-13-111881-1.
and it includes chapters 1 to 5 of [1].
2003 Practical laboratory content
(2003 - PP) Notes for the "Procedural Programming" part of PR611 (formerly PR211):
Exercise PP1 (Typing in, compiling, and running your first C++ program. Keyboard input and screen output statements).
Exercise PP2 (Date and time in C++; system commands, string functions and their parameters).
Exercise PP3 (Selection and iteration statements in C++).
Exercise PP4 (Sequential file handling in C++: .open, .getline, .write, .close functions; backups).
Exercise PP5 (Modular programming in C++: functions and menu program).
Exercise PP6 (Bubble Sort).
Exercise PP7 (Array handling and strings handling in C++).
Exercise PP8 (Printing in C++ on a stand alone printer).
(2003 - OO) Notes for the "Object Oriented Programming" part of PR611 (formerly PR211):
Lecture L1 (Classes and objects in OO C++).
Exercise OO1 (Typing in, compiling, and running your first GUI Borland C++ OO program; screen output methods).
Exercise OO2 (Random number generator).
Exercise OO3 (Date and time retrieval from the system in OO C+).
Exercise OO4 (Array handling, string handling and control statements in OO C++).
Lecture L7 (Inheritance and Polymorphism in OO C++).
2002 - PR211
(2002 - OO Theory) PR211 course in 2002:
Lecture L6 (Classes and objects in OO C++).
Lecture L7 (Inheritance and Polymorphism in OO C++).
(2002 - OO Laboratory): PR211 course in 2002 - exercised on visual OOC++:
Exercise E1 (Typing in, compiling, and running your first visual OO C++ program; screen output statements).
Exercise E2 (Random number generator).
Exercise E3 (Date and time retrieval from the system in OO C++).
Exercise E4 (Array handling, string handling and control statements in OO C++).
Exercise E5 (Arithmetic operations in OO C++).
(4/2002 - OO Assessment): PR211 course in 2002 - assessment of OOC++:
Pre-exam revision of material (It contains examples of exam questions)
Assignment 1 (Pager in visual OOC++)
Assignment 2 (Calculator in visual OOC++)
Assignment 3 (Classes and objects in console OOC++)
Solutions for 2002 console OO C++:
Program for Exercise L6 (it shows how to create a class "square bar").
Bar.cpp: Cpp Source file (console) for "square bar" (L6).
Bar.exe: Executable file for "square bar" (L6).
Program for Exercise L7 (it shows how to manage inheritance and polymorphism).
Family.cpp: Cpp Source file (console) for "family" (L7).
Family.exe: Executable file for "family" (L7).
Solutions for 2002 Visual OO C++ exercises:
Program for Exercise 3 (it shows how to extract date and time from the system).
DTime.exe: Executable file for E3.
E3.zip: A directory (e3) with all files for E3, including C++ source code.
Solution for Exercise 4 (it is an OO C++ program that converts Arabic numbers into Roman numbers).
ArabicToRoman.exe: Executable file for E4 Project.
E4.zip: A directory (e4) containing all files for E4, including C++ source code.
Solution for Exercise 5 (it is an OO C++ program that finds all prime numbers contained between two input numbers).
E5_prime.exe: Executable file for E5 Project.
E5_prime.zip: A directory (e5_prime) containing all files for E5, including C++ source code.
Solutions for Visual C++ assessment problems, 4/2002:
Projects for Assignments in OOC++ (topics listed above under the heading "assessment problems").
Pager.exe: Executable file for Assignment 1 (pager).
Pager.zip: A directory (pager) with all files for Assignment 1 (pager), including C++ source code.
As2_calc.exe: Executable file for Assignment 2 (C++ calculator).
As2_calc.zip: A directory (as2_calc) with all files for Assignment 2 (C++ calculator), including C++ source code.
Cylinder.cpp: Cpp Source file (console) for a "cylinder" class (As.3).
Cylinder.exe: Executable file for Assignment 3 (Cylinder class).
Instructions:
(1) Each solution presented here was done in Borland C++ 5 Builder.
(2) Each OO C++ solution consists of 5 separate files. Note that Borland C++ 5
does not like any of the files is missing, and does not tolerate easily moving
of files around. Before you get through the trouble of dowloading to your
computer all these files, check first by dowloading the *.exe file as in
item (3) below, whether you are interested in analysing this particular solution.
(3) In order to download to your computer (to test how it works) the executable
version of a given solution (*.exe),
click on it, and when the system asks you where to save it,
provide a name of the directory from which you wish to run it.
(4) In order to download to your computer all remaining files of a given solution,
click on the *.zip file, download this *.zip file to your computer, and then unzip
this file in the directory in which you wish to execute it. (Note that all solutions
available here were prepared to be run from a hard disk C:, and that they are all
zipped as the entire directory En).
(5) To return to this Web page, click on the Back button on the tool palette
of your browser.
(6) Address for correspondence (June 2005): Dr Jan Pajak, P.O. Box 33250,
Petone 6340, New Zealand.
Note that "self-paste" type exercises, which prepare students for solving
these programming problems, are outlined in OO C++ exercise notes.
|