using c++ language
Instructor: Bushra Alhijawi Fall 2020/2021 Student Name Student Univ. ID Date Q1 QZ Q3 (30) (40) (30) 100% 90% 75% 50% 0% Total (100) Grading Criteria 100%: Program is fully correct, code is well-indented, identifiers are well-named and the output is well formatted. 90%: Program is fully correct but meaningless identifier names are used, indentation is bad, or output is not well formatted. 75%: Program runs mainly correctly. It fails to adhere to some of the specifications. 50%: Program contains syntax errors but seems correct. 0%: Program has serious syntax and/or logical errors. Lab Objectives Dynamic Memory management for objects Dynamic Memory management within class this pointer friend functions Lab Instructions Create a new folder on desktop and name it by your "ID-FirstName-LastName-Lab". 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 five files on the e-learning: two header file (h) for two classes, three 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. Exercise 1 - Define Participant Class Exercise Objectives Define class Problem Description You will develop the one header file (participent.h) and one CPP source file (participent.cpp) in this exercise. Define and implement a class called student contains Three private variables: noOfHour (int), spa (int), and name (string). You should ensure that both noOfHour and grade greater than 15 and 60, respectively. Default and parametrized constructor. One destructor Getter and setter functions. Exercise 2 - Define Certificate Class Exercise Objectives Define class certificate Problem Description -ID: const int You are supposed to declare and implement - major string certificate class as follows: name: string A class called certificate (as shown in the class noOfPar: int diagram) contains: -"participent[]: participent o Member variables to store the certificate certificate(string name, string major) ID (int), major (String), name (String), the certificate (course & c) number of participants that register in this certificate certificate and which participants are they SetParti( parts [ participent, int noOfP): void Note that the number of participants is getmajor() string unknown and can vary from certificate to + getName(): string another. ID variable should be constant + getNoP(); int and automatically increase starting by setMajor(); void 500. Such as first object's id is 500, second setName(); void object id is 501.and so on. + setNoP 0):void A certificate class constructor that receives name and major. o Copy constructor Page 2 of 3 A member function SetParticipants() which sets the participants for certificate according to received array of participants. Note that this function can be used to change the participants as well. A Destructor for certificate Class. Setters and getters for major, name, and number of participants. o Make all getters constant functions. A friend function float GetAvgGrade (course &c) that returns the average of all participants grade in a certificate. Exercise 3 - Implement Main Exercise Objectives Declare objects Use constructor and destructor Problem Description Write the main function: Create an array of 3 students called PHPCert (Ali, Maria, and Mira) with NumofHours (15, 20,15). and Grade (90, 65,91). Create an array of 4 students called MarketingCert (Maher, sally, and tala, Ahmad) with NumofHours (20,40,17,15), and Grade (80, 84, 95,93). Participant PHPCert[3]={{"Ali",15,98}, {"Maria", 20,91},{"Mira", 15,91}}; Participant Marketingcert [4]-{{"Maher,20,80},{"sally",40,84), ["tala",17,95},{"Ahmad, 15,95}}; Create two certificate objects (PHP, and Marketing). Set the major and name of PHP to "CS" and "php". Set the major and name of Marketing to Business and marketing Set the PHPCert to the PHP, and Marketing Cert to the Marketing. Print out the average grade of participants of each certificate. Write the code to ask the user of how many students he/she want to register, then create an array of participants based on his input and let him/her fill their information Replace the participants in Marketing, with the participants entered by user in the previous step. Page 3 of 3