Problem

Complete the following tasks:a. Create a class named Teacher that holds a Teacher’s first...

Complete the following tasks:

a. Create a class named Teacher that holds a Teacher’s first and last names and the grade level the Teacher teaches. Include a constructor function that uses default first and last names, such as “ZZZZZZZ” and a default grade level, such as 0, when no arguments are provided.


b. Create a class named Student that hold’s a Student’s first and last names. Include a constructor function that uses default first and last names, such as “ZZZZZZZ,” when no names are provided.


c. Create a class named Classroom. A Classroom holds a Teacher and an array of 35 Student objects.


d. Create a class named School. A School contains an array of 100 Classroom objects. (This class is being designed to be a very large class, to more quickly demonstrate running out of memory.)


e. In a main()demonstration function, declare a pointer to an array of 500 School objects and include code to handle any memory allocation errors that occur. In a loop, declare 500 array objects at a time, continuing to rewrite the main()function if necessary until you create enough School objects to cause a memory allocation exception. (Hint: You might want to display a count periodically to assure yourself that the School objects are being created.) When memory is exhausted, display an appropriate message and terminate the application. Save the file as School.cpp.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT