- 4 In Q Building There Are Three Different Types Of Lecture Halls Auditorium Small Minand Medium Midaud And Larg 1 (61.61 KiB) Viewed 46 times
4. In Q building there are three different types of lecture halls (Auditorium): small (Minand), medium (MidAud) and larg
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4. In Q building there are three different types of lecture halls (Auditorium): small (Minand), medium (MidAud) and larg
4. In Q building there are three different types of lecture halls (Auditorium): small (Minand), medium (MidAud) and large (MacAud). The capacity of lecture halls is different; the base capacity is a static variable of the base class (baseCapacity -30). The capacity of the small lecture hall is two times the base capacity (inFactor-2), the capacity of the medium lecture hall is 4 times the base one (midFactor) and the capacity of the large lecture hall is 12 times the base one (maxFactor-12). Our program should store the lecture Halls in a pointer array. The task is to calculate and display the capacity of each lecture hall in the array (capacity). Design and draw the inheritance hierarchy of the classes. Take care of providing an elegant object-oriented solution! Implement the classes and the constants in the namespace Building Q. Use the names for classes, functions, and variables presented above and denoted by Italic. Please note that certain constants should be implemented as (static) attributes. Ensure that adding a new lecture hall can be achieved without modifying the already existing classes. There is no lecture hall in general (without size). and the buse class Auditorium does not exist as a lecture hall, so do not allow instantiation of the base class. Do not allow manipulation of the base capacity (baseCapacity) in any way (e.g., from the derived classes, from external functions, etc.) Do not use VO operations in the classes, but only in the main function. Write a simple program fragment that calculates and lists the capacity of all lecture halls stored in the program by displaying the Frame of the lecture hall and its capacity, e.g.: Medium: 120 Large: 360 Medium: 128 Small:60 Large: 360 - non-dynamic array management: instantiate 5 lecture halls, fill the array with them, and iterate through the array, 35 points - Inheritance hierarchy