Question: in c++ Question 4 (30 Marks): Driver program 1) Write a non-member function int countBachelor(Student * group[], int n, string major, string rating) that receives

in c++

in c++ Question 4 (30 Marks): Driver program 1) Write a non-member

function int countBachelor(Student * group[], int n, string major, string rating) that

receives an array of Student pointers, the size of the array n,

Question 4 (30 Marks): Driver program 1) Write a non-member function int countBachelor(Student * group[], int n, string major, string rating) that receives an array of Student pointers, the size of the array n, a major and rating and returns the number of Bachelor students who have that major and that rating in the received groups array. 2) Write a main function that: A. Defines an array of Student pointers of size 5 B. initialize the attributes of the 5 student objects in the array using input data from user. The input should include data for both bachelor and master students of majors. C. Print all students information using an appropriate member function call from a loop D. Count the number of students who are bachelor, of major CS and rating Good. E. Answer the following by adding comment at the end of the main //1. can you declared objects of type Student? explain your answer //2. if you declare a pointer of type Student, what can you store in it? //3. when would a virtual destructor be necessary //4. Do we need a virtual destructor in this program? why or why not? 11959pm Objectives Understand and practice o Inheritance Polymorphism Virtual vs. non-virtual functions Abstract classes o General Notes (Important): 1. In this assignment, you are given part of the implementation as a help 1.1. Feel free to use it 1.2. It is not complete. You will need to address any requirements that are not implemented 2. This is an individual assignment. 2.1. You are not allowed to work in groups 2.2. make sure you do not share code with any other student 2.3. It does not matter if you give your code to other students or they get it without your permission! In both cases that would be considered as cheating. 2.4. Cheating is strictly prohibited and will cost you severely, possibly the whole course or even the semester 3. You should submit your work via e-learning as one zip/tar file that has 3.1. header files *.h: for class interface (one for each class) 3.2. source files *.cpp : for class implementation (one for each class) 3.3. main.cpp : main program (only one) 3.4. guard your header files against multiple inclusions 4. The member functions that do not modify data members should be declared and defined as const 5. Write any type of constructors, setters, or getters your program might need. You are asked to implement a class hierarchy for students in a university. There are two categories of students, Bachelor and Master. You need to implement a base class Student, and two derived classes, one for the Bachelor students and another for the Master students. Assume that each student in the university has a studentiD, a name, o gpa, and a major. Bachelor students are required to do a graduation project and training at some company. Master students are required to do a thesis. Bachelor student rating is different from Master student rating

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!