Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ please Lab Exercises This assignment consists of three exercises. You should submit your code in seven files on the e-learning: three header file

image text in transcribed

image text in transcribed

image text in transcribed

in c++ please

Lab Exercises This assignment consists of three exercises. You should submit your code in seven files on the e-learning: three header file (h) for two classes, four CPP source files (.cpp) for classes implementation and the main function. Also, in your header file, you must prevent multiple file inclusion. Your code should use separate implementation of the class. Lab Exercises Person (-) name Type: string (-) address Type: string (-) birthYear Type: int (-) nationalNo Type: int (+) Parameterized Constructor (+) Setters (+) Getters (+) printDetails : void Employee Student (-) salary Type: int (-) major Type: string (-) department Type: string (-) GPA Type: string (+) Parameterized Constructor (+) Parameterized Constructor (+) Getters (+) Getters (+) Setters (+) Setters NOTE 1: In all of your code, do not forget to validate all user input and to make all functions that do not modify the class constant. NOTE 2: Avoid duplication of codel If something is already done in the base class, do not do it again in the derived class. Exercise 1-Define Person Class olach Exercise 1- Define Person Class Exercise Objectives Define class Problem Description Implement class Person. The parametrized constructor initializes the values of all data members. Function printDetails should print information about the person in a well-formatted manner. Page 2 of 3 Exercise 2 - Define Employee Class Exercise Objectives Define class Problem Description Declare and implement Employee, which inherits from class Person. Note the following: The salary data member represents the salary of the employee in JOD. The department data member can be either "IT" or "Finance". Function printDetails of the base class should be overridden to print the additional information about the salary and department. Exercise 3 - Define Student Class Exercise Objectives Define class Problem Description Declare and implement Student, which inherits from class Person. Note the following: The major data member can be Computer Science, Software Engineering, Accountant or Economy. > Function getName in the base class should be overridden to return the name + "(Student)". Function printDetails of the base class should be overridden to print the additional information about the major and grade. Exercise 5 - Implement a Friend Function Exercise Objectives Define Friend Function Problem Description Write a friend function (checkGPA) to the Student class to return True if the student GPA is more than or equals to 85. Otherwise, it returns False. Exercise 4 - Implement Main Write the main function as follows. Create an object of type Employee (EMP), assign the appropriate values for each data member. Create an object of type Student (STD), assign the appropriate values for each data member. Print the details of both objects. The company owner wants to hire the STD in an appropriate department, you are asked to check the major and GPA of STD If case STD's major is Computer Science or Software Engineering, then STD should be in IT department. Otherwise, STD should be in Finance department. o If STD's GPA is greater than or equal to 85 then set the salary to 500, otherwise, the salary is 450. Declare a new Employee object called (freshGrad) to hire STD in the company. O Page 3 of 3

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_2

Step: 3

blur-text-image_3

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Identify several warning signs of computer crimes.

Answered: 1 week ago

Question

Identify external recruitment sources.

Answered: 1 week ago