Write a c++ oop code following these instructions only. Class Scene: capture_date : int draw() : void // Abstract method Class Landscape: area : double render(): void Class FlightSimulator: It has aggregation relationship with abstract class Redefine draw() function that has only a print statement of “Drawing Scene”. Class MountainScene: Call render function of Landscape as mentioned in diagram. (a) Add a function getArea() in 'Scene' class. Class Scene: capture_date : int draw() : void // Abstract method getArea() : string // Displays 'Area of Scene' Class CityScene: draw() : void getArea() : string // Displays 'Area of City Scene' Class MountainScene: draw() : void getArea() : string // Displays 'Area of Mountain Scene' (b) 1- Create a pointer of Scene class 2- Assign object of MountainScene class to the pointer created in part 1 3- Call getArea() through the pointer 4- Report the output you get in part 3
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a c++ oop code following these instructions only.
Class Scene:
capture_date : int
draw() : void // Abstract method
Class Landscape:
area : double
render(): void
Class FlightSimulator:
It has aggregation relationship with abstract class
Redefine draw() function that has only a print statement of “Drawing Scene”.
Class MountainScene:
Call render function of Landscape as mentioned in diagram.
(a) Add a function getArea() in 'Scene' class.
Class Scene:
capture_date : int
draw() : void // Abstract method
getArea() : string // Displays 'Area of Scene'
Class CityScene:
draw() : void
getArea() : string // Displays 'Area of City Scene'
Class MountainScene:
draw() : void
getArea() : string // Displays 'Area of Mountain Scene'
(b) 1- Create a pointer of Scene class
2- Assign object of MountainScene class to the pointer created in part 1
3- Call getArea() through the pointer
4- Report the output you get in part 3
Step by step
Solved in 3 steps