Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions