Print Name __________________________
Signature __________________________
Quiz/In Class DellComputer Makefile
Lab
Individual Assignment
15 Points
All Labs, unless specified otherwise, are to be completed
and brought to the next class period. The wire-band binders,
containing these labs, will be collected once a week;
see the class schedule.
ADT is an acronym for ___________________________________________
Stack is a {LIFO/FIFO} ______________________________ structure/ADT.
Queue a {LIFO/FIFO} ______________________________ structure/ADT.
LIFO is an acronym for ___________________________________________
FIFO is an acronym for ___________________________________________
A Function Which Calls Itself is {Iterative/Recursive} _____________________
The Three Requirements Of Recursive Functions Are .................................
(1) _________________________________________________
(2) _________________________________________________
(3) _________________________________________________
Three Primitive Operations On The Stack Are ________________________
The Primitive Operation For Placing Elements In A Stack is called __________
The Primitive Operation For Removing Elements From A Stack is called _____
The Primitive Operation For Determining If A Stack Is Empty is called ______
Three Primitive Operations On The Stack Are _______________________
The Three Categories Of Items Pushed To A Stack During Recursive Functions Are
(1) __________________________________________________
(2) _________________________________________________
(3) _________________________________________________
Record reasons why we partition a program into .hpp and .cpp
files.
[also could be done in .h and .c] [also could be done
in .h and .cpp]
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
What Goes Into the Class .hpp File?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
What Goes Into the Class .cpp File?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
What is the function of the lines and where are they placed within the code?
# ifndef PART_TYPE // ==============================================
# define PART_TYPE
# endif // PART_TYPE ===============================================
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
1] Include the following Main.cpp file:
| //////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// // // // Main.cpp // // // // Purpose : Evoke The Test Module for class Part. // // // // Written By : Dr. Thomas E. Hicks Environment : Windows NT // // Date : 8/22/00 Compiler : Visual C++ // // // ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// // ------------------------------- Includes --------------------------------------
// ------------------------------- Defines --------------------------------------- main (int argc, char * argv[])
|
2] Include the following Part.hpp file:
| //////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// // // // Part.hpp // // // // Purpose : House includes, defines, class definitions, function // // prototypes, and all template methods. // // // // Written By : Dr. Thomas E. Hicks Environment : Windows NT // // Date : 8/26/00 Compiler : Visual C++ // ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// # ifndef PART_CLASS //============================================================ // ----------------------------------- Includes ----------------------------------
// ----------------------------------- Defines -----------------------------------
//////////////////////////////////////////////////////////////////////////////////
private:
// ------------------------- Non-Class Functions Prototypes-----------------------
# endif // PART_CLASS ============================================================
|
3] Include the following Part.cpp file:
| //////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// /// Part.cpp // /// // /// Purpose : House all non-template methods for class Part. // /// House function TestPart(void). // /// // /// Written By : Dr. Thomas E. Hicks Environment : Windows NT // /// Date : 8/26/00 Compiler : Visual C++ // ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ///--------------------------- Includes ----------------------------------
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
Part
cout << "\n************* Testing Display Method
[verifies constructor init]\n";
cout << "\n************* Testing Set Method\n";
cout << "\n************* Display50 by boxing in the informatin\n\n"; cout << "| 12345678901234567890123456789012345678901234567890
|\n";
cout << "\n************* The destructor
will be called 5 times when exiting\n";
//////////////////////////////////////////////////////////////////////////////////
************* Testing Display Method [verifies constructor init]
************* Testing Set Method
************* Display50 by boxing in the informatin | 12345678901234567890123456789012345678901234567890 |
************* Testing Constructor - Delcalre An Array of 4
Parts
************* The destructor will be called 5 times when exiting
|
4] Create a folder called DellMake. Copy files Main.cpp, Part.hpp, and Part.cpp from this lab or E-Mail into this folder DellMake.
5] Use Putty or Telnet to log on to one of the red hat
systems [xenaxx.cs.trinity.edu, janusxx.cs.trinity.edu]. Use vi to create
the following makefile: Note that the second lines of each set must be
tabbed! (g++/rm
lines)
| Dell: Main.o Part.o
g++ -o Dell Main.o Part.o Part.o: Part.cpp Part.hpp
Main.o: Main.cpp
clean:
|
6] Enter the following on the command line.
make Dell7] Write the names of all of the files, and their respective sizes, that now exit in your Dell folder on the Linux account.
ls -l
------ File Name ---------------------------------- ---- No Bytes ---
Main.cpp
____________________________________________
________________
____________________________________________ ________________
____________________________________________ ________________
____________________________________________ ________________
____________________________________________ ________________
____________________________________________ ________________
____________________________________________ ________________
____________________________________________ ________________
____________________________________________ ________________
8] Do the following when program is complete.
Dell > Output.txt <-- Runs the program and dumps output into file Output.txt
9] Use Visual C++ To Print the following: with Margins!
Makefile
Main.cpp
Part.hpp
Part.cpp
Output.txt
A] Divider
B] Copy of this assignment sheet. Using an ink pen, print your name and sign this lab at the top.
C] Listings Makefile Main.cpp, Part.hpp, Part.cpp, Output.txt
D] Disk Containing Makefile Main.cpp, Part.hpp, Part.cpp, Output.txt
E] Divider