Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ seven files please an needed and using online gdb compiler Lab Instructions Create a new folder on desktop and name it by your ID-FirstName-LastName-Labi.

c++ seven files please an needed and using online gdb compiler

image text in transcribed

image text in transcribed

Lab Instructions Create a new folder on desktop and name it by your "ID-FirstName-LastName-Labi. Make sure to save your solutions in this folder. You must upload your solutions to e-learning as follows: o Each project you create it as a .zip file. A text file associated with each project contains a copy of the code. Page 1 of 3 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 (-) birth Year Type: int (-) national No 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 code! If something is already done in the base class, do not do it again in the derived class. 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. 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. 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 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

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

2 What participation techniques are used?

Answered: 1 week ago

Question

Question Can plan participants borrow from a VEBA?

Answered: 1 week ago