Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ Exercise 1 - Define Student Class Exercise Objectives Define class Problem Description You will develop the one header file (student.h) and one CPP

image text in transcribed

image text in transcribed

in c++

Exercise 1 - Define Student Class Exercise Objectives 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 course Problem Description You are supposed to declare and implement Course class as follows: A class called Course (as shown in the class diagram) contains: 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. Copy constructor. 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 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. Setters and getters for course department, course name, and number of students. Make all getters constant functions. 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 (CflusPlus, 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 with AI-Powered 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

Students also viewed these Databases questions