Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm writing a Visual Studio Code program as an example of inheritance. The main application must do the following: Create an instance of each class

I'm writing a Visual Studio Code program as an example of inheritance.

The main application must do the following:

Create an instance of each class using parameters of your choosing

Print each class's properties to the console using the ToString method

Print the following for your instance of the Car class using the get accessors (in this order):

Color

Number of Seats

Engine Size

Whether or not it has an Automatic transmission

Whether or not it has a Sun Roof

Storage Capacity size

Class Vehicle will be the overall base class and will have the properties and methods described below

Wheels - type integer, the number of wheels the vehicle has

Color - type string, the color of the vehicle

Moving - type Boolean, indicator of whether or not the vehicle is currently moving

Seats - type integer, the number of seats available in the vehicle

Class Motorized is derived from Vehicle and will have the properties described below

Engine - type string, description of the engine (e.g. 2.6L V6)

Automatic - type Boolean, indicator of automatic or manual transmission

In the ToString override, DO NOT use the base class's ToString method - use the base class's property accessors to output the base class's data

Class Bicycle is derived from Vehicle and will have the properties described below

Gears - type integer, the number of gears the bicycle has

Seat Height - type double, the height of the bicycle

Tire Size - type double, the size of the bicycle's tires

in the ToString override, use the base class's ToString method to output the base class's data

Class Car is derived from Motorized and will have the properties described below

Sun Roof - type Boolean, indicator of whether or not the car has a sunroof

Storage - type string, describes the storage area the car has (e.g. None, Small Trunk, etc.)

Class Truck is derived from Motorized and will have the properties described below

Load - type string, describes the capacity the truck can carry (e.g. 2 ton, long bed)

Towing - type Boolean, indicator of whether or not the truck is capable of towingimage text in transcribedimage text in transcribedimage text in transcribed

Your Name - Week 1 Inheritance Performance Assessment Color: Red Wheel Count: 3 Seat Count: 2 Currently Moving: False Color: Blue Wheel Count: 2 Seat Count: 1 Currently Moving: True Number of Gears: 12 Bicycle Height: 36 Color: Orange Wheel Count: 4 Seat Count: 2 Currently Moving: False Engine: 3.6L v6 Automatic Transmission? True Color: Maroon Wheel Count: 4 Seat Count: 5 Currently Moving: False Engine: 2.4L 4-CYL Automatic Transmission? False Storage: None Has Sunroof? True Color: Black Wheel Count: 6 Seat Count: 6 Currently Moving: True Engine: V8 Hemi Automatic Transmission? False Color: Maroon \# of Seats: 5 Engine Size: 2.4L 4-CYL Automatic Transmission? False Has Sunroof? True Storage: None

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

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions

Question

1. Briefly describe the five components of emotions.

Answered: 1 week ago