Question: C++ programming 2 code blocks. Please solve as written and in simple method . Define the following five classes with public inheritance, they represent five
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 ( derived ) with data members (string ABS, int airbags, int cost ) and functions ( set , print, find Cost), Class Luxury (derived ) data members (string leather Seats, string GPS ) and functions (set , print, find Cost ), Class Al (derived) members ( char night vision , string selfchecking ) and functions (set print, find Cost), Class Executive ( derived) members ( char fax, conferencing) and functions (set, print, find Cost) int main0 Safety one( Camery", 58000, "EIS5.8", 2) Luxury two Camery", 58000, "EIS5.8", 2, "Embroidery", "eTrex"); AI three( Camery", 58000, "EIS5.8", 2, "Embroidery", "eTres", N', "Partial") Executive fourl"Camery", 58000, "EIS5.8", 2, "Embroidery", "eTrex", 'N', "Partial", N, Y); Car ptrCarl4]; ptCar[0)-&one ptrad i ] = &two; ptrCarl2]-&three lpturCarl3]-&four for int i-0; iprinto cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
