Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will develop the one header file (student.h) and one CPP source file (student.cpp) in this exercise. Define and implement a class called student contains:

You will develop the one header file (student.h) and one CPP source file (student.cpp) in this exercise. Define and implement a class called student contains: Three private variables: noOfHour (int), grade (int), and name (string). You should ensure that both noOfHour and grade greater than 0. Default and parametrized constructor. One destructor. Getter and setter functions. Exercise 2 Define Course Class Exercise Objectives Define class Problem Description You are supposed to declare and implement Course class as follows: A class called Course (as shown in the class diagram) contains: o Member variables to store the course ID (int), course department (String), course name (String), the number of students that register in this class and which students are they. Note that the number of students is unknown and can vary from course to another. ID variable should be constant and automatically increase starting by 700. Such as first objects id is 700, second object id is 701and so on. o A Course class constructor that receives course name and course department. o Copy constructor. course - cID: const int - dept: string - name: string - noOfStd: int - *Students[]: Student + course(string name, string dept) + course (course & c) + ~course() + SetStudents ( Student [] student, int noOfStd): void + getDept():int + getName(): int + getNoStd(): int + setDept():int + setName(): int + setNoStd(): int Page 3 of 3 o A member function SetStudents() which sets the students for course according to received array of students std. Note that this function can be used to change the students as well. o A Destructor for course Class. o Setters and getters for course department, course name, and number of students. o Make all getters constant functions. o A friend function float GetAvgGrade (course & c) that returns the average of all students grade in a course. Exercise 3 Implement Main Exercise Objectives Declare objects Use constructor and destructor Problem Description Write the main function: Create an array of 4 students called CSStudents (Ali, Ahmad, Maria, and Mira) with NumofHours (54, 27, 36, 15), and Grade (77, 84, 91, 68). Create an array of 3 students called MISStudents (Maher, sally, and tala) with NumofHours (20, 40, 12), and Grade (80, 84, 95). StudentCSStudents[4]={{"Ali",54,77},{"Ahmad",27,84},{"Maria",36,91},{"Mira", 15,68}}; Student MISStudents[3]={{"Maher",20,80},{"sally",40,84},{"tala",12,95}}; Create two Course objects (CPlusPlus, and WEB), let the user fill their other information such as department and name Set the CSStudents to the WEB, and MISStudents to the CPlusPlus. Print out the average grade of each course. Write the code to ask the user of how many students he/she want to register, then create an array of students based on his input and let him/her fill their information. Replace the students in CPlusPlus, with the students entered by user in the previous step.

image text in transcribed

Exercise 1 - Define Student Class Exercise Obiectives Define class Problem Description You will develop the one header file (student.h) and one CPP source file (student.cpp) in this exercise. Define and implement a class called student contains: Three private variables: noOfHour (int), grade (int), and name (string). You should ensure that both noOfHour and grade greater than 0. Default and parametrized constructor. One destructor. Getter and setter functions. Exercise 2 - Define Course Class Exercise Objectives Define class Problem Description You are supposed to declare and implement Course class as follows: A class called Course (as shown in the class diagram) contains: o Member variables to store the course ID (int), course department (String), course name (String), the number of students that register in this class and which students are they. Note that the number of students is unknown and can vary from course to another. ID variable should be constant and automatically increase starting by 700. Such as first object's id is 700, second object id is 701...and so on. A Course class constructor that receives course name and course department. o Copy constructor. course - CID: const int -dept: string -name: string - noOfStd: int *Students(: Student + course(string name, string dept) + course (course & c) + course() + SetStudents ( Student [] student, int noOfStd): void + getDept():string + getName(): string + getNoStd(): int + setDept():void + setName(): void + setNoStd(): void Page 2 of 3 o o A member function SetStudents() which sets the students for course according to received array of students std. Note that this function can be used to change the students as well. A Destructor for course Class. o Setters and getters for course department, course name, and number of students. o Make all getters constant functions. A friend function float GetAvgGrade (course & c) that returns the average of all students' grade in a course. O Exercise 3- Implement Main Exercise Objectives Declare objects Use constructor and destructor Problem Description Write the main function: Create an array of 4 students called CSStudents (Ali, Ahmad, Maria, and Mira) with NumofHours (54, 27, 36, 15), and Grade (77, 84, 91, 68). Create an array of 3 students called MISStudents (Maher, sally, and tala) with NumofHours (20, 40, 12), and Grade (80, 84, 95). Students Students[4]={{"Ali", 54,77},{"Ahmad", 27,84},{"Maria", 36,91},{"Mira" 15,68}}; Student MISStudents[3]={{"Maher", 20,80},{"sally", 40,84},{"tala",12,95}}; Create two Course objects (CPlusPlus, and WEB), let the user fill their other information such as department and name Set the CSStudents to the WEB, and MISStudents to the CPlusPlus. Print out the average grade of each course. Write the code to ask the user of how many students he/she want to register, then create an array of students based on his input and let him/her fill their information. Replace the students in CPlusPlus, with the students entered by user in the previous step

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

What is the function of macrophages?

Answered: 1 week ago