Question: Given this code struct Course { char courseName[30]; char* professor; int studentCount Student** students; }; a) Write a function that creates a course with a

Given this code

struct Course {

char courseName[30];

char* professor;

int studentCount

Student** students;

};

a) Write a function that creates a course with a given name and a given professor and that contains a certain number of random students. Each student score should be <= MAX_SCORE. No "cout" in function. You should call the getRandomStudents() function above in this function to fill in the students data.

Course* getCourse(string courseName, string professor, int studentCount);

b) Write a function to print the student data in the structure. Must use "cout" in function.

Output looks like this:

Course name: CIS22B

Professor: First Last

Class size: 20

Student list:

Scores: 10 18 20 19 5 17 11 18 5 12

Student name: D67

Scores: 17 19 20 11 5 17 11 13 5 12

Student name: X347

Scores: 10 18 20 19 15 19 18 12 15 12

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!