Question: Virtual Functions . C++ programming 2 using code blocks. Please solve as written and in an easy method . Define the following five classes with

 Virtual Functions . C++ programming 2 using code blocks. Please solve
as written and in an easy method . Define the following five
Virtual Functions .
C++ programming 2 using code blocks.
Please solve as written and in an easy method .

Define the following five classes with public inheritance, they represent five different car accessories Class Car (base) with data members (string model, int price) , Class Safety (inherits Car) with data members (string ABS, int airbags, int cost) and functions (set , print, find Cost), Class Luxury (inherits Safety) data members ( string leather Seats, string GPS) and functions ( set ,print , find Cost ) , Class AI (inherits Luxury) members (char night vision, string selfchecking) and functions (set , print, find Cost) , Class Executive(inherits AI) members ( char fax, conferencing) and functions (set , print, find Cost). int main0 Safety one"Camery", 58000, "EIS5.8",2); Luxury twol"Camery", 58000, "EIS5.8", 2, "Embroidery", "eTrex"); AI three" Camery", 58000, "EIS5.8",2, "Embroidery" "eTrex", N', "Partial"); Executive four Camery", 58000, "EIS5.8", 2, "Embroidery", eTrex, N, "Partial", 'N, Y: Car *ptrCar4]; ptrCarl0]-one; ptCarl1]-&two; ptrCar[2]-&three ptCarl3]-&four for(int i-o i-4; i++) ptCarfil->findCost0: ptCarli- printo: cout

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!