Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 1- Compatibility Mode s Mailings Review View Strong HINT: Make sure and DESIGN your class first. Think about what member functions it needs and

image text in transcribed
Lab 1- Compatibility Mode s Mailings Review View Strong HINT: Make sure and DESIGN your class first. Think about what member functions it needs and what data members it needs. If you write your UMI, first it will be easier. I will give you a base design but you should add to it o You are going to create a basic inheritance hierarchy to keep track of course information at a college CollegeCourse, is going to be your base class and LabCourse is going to be your derived class. A LabCourse is everything a CollegeCourse is BUT there is an additional lab fee. After you create your classes using inberitance you're going to create a client program (a main) to test out your class data types. Have College Course be the te base class of the hierarchy, then Labourwill derive from CollegeCourse Base class CollegeCourse should include: o member variables representing the: course department (for example ENG or CSIS), the course o CollegeCourse should have one constructor that initializes ALL of these member variables (so all o CollegeCourse should have one no argument constructor. For this constructor have it initialize o number (for example 211), the units the course is worth (for example 3), the name of the course, and the total fee for the course (for example $360). all the member variables to reasonable default values (you decide). unit and units are positive numbers. Use good design! Look back at CSIS 135 if you've forgotten. o The proper get and set functions should be included for each member variable. Ensure that the fee per o CollegeCourse should have a display() member function that displays all the course data. o Derived class LabCourse should inherit the functionality of base class CollegeCourse but also should include an additional member variable (labEcc) that represents the lab fees for the course. Lab fees can vary based on the type of lab course (Chemistry, Biology stc) o LabCourse' s constructor should receive a value to initialize this lab fee member variable. Don't forget the derived class is REQUIRED to call the base class constructor. You can use the z constructor (especialy if your new to inheritnce in C++) but it's probably better to use base that takes 5 arguments (if you took CSIS 137 try to do it this way!). The base class initializer syntax is in the slides if you are interested 137 try to use the best design you can if you didn't just try to get the basic idca of re -defining an LabCoruse), and lests ALL, the member functions to make sure they are working properly. NOTE: the test urse should redefine member function display so that it displays the lab fees for the course and when it prints the total fee it should include the lab fee added in. Again if you took CSIS inherited member function here. -Finally, write a test program that creates objects of each ope of course (CollegeCourse and program does NOT need to be fancy (so no menu or tancy loop nceded) just create an instance of each course and test all yorna methods to see that they work Cl Focus

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions