PROJECT: C++ with STL

 

Purpose
This project gives you a chance to review and understand the important features that C++ and STL promise through programming practice. Please read the following instructions carefully.

Contents and Structure

The project mainly covers three features: STL, inheritance and polymorphism

Part 1 (55 points)
In this part, you design and implement all the classes in the UML diagram on the last page. Polymorphism is emphasized.

a) (30) general specifications:

 

b) (25) call print() and tuition() for the following three students using both static and dynamic binding:

under_rate = 380.0; grad_rate = 500;

These are just facts data; your final output may look differently (but nicely).

Part 2 (45 points)
This part involves I/O streams, files, and STL.

Suppose that input undergraduate roster is a text file in which fields are separated by white-space “ ” and records by “\n”. For example, the first record (the fields are all in the following order: name, ssn, year, credits, gpa) could be
“Mary”, “000111222”, “Junior”, 12, 4.0

 

Header line:
Name   SSN     Year    Credits                        Tuition             GPA
……

In each line (including the header), each field’s width is10 except “Name” whose width is 20. The last two fields are right-justified and have two fraction digits. Tuition must be padded with $ sign to the left. All other fields are left-justified.

Submission Instruction

 

1) Code must be run on a Linux machine.
2) Electrical copy by email and hard copy are required for each submission.
3) You submit one source file named as “X_Undergrad.cpp” (X is your logon username e.g. l_fu ) and put all the drivers in the main function of class “Undergrad”. The output order appears as required above. If you have comments or “readme” things (and you should), put them in the beginning as a comment block.

4) File including the source file must be well-documented. Code is self-evident (e.g. clear names) and comments are concise, sufficient, and accurate.