Write a console-based C# app that uses the concept ofinheritance to model motor vehicles as follows:1. Define an abstract class named MotorVehicles that has the following fourabstract methods:a. void driveForward()b. void stop()c. void driveBackward()d. void turn(string direction)2. This abstract class should:• have the following properties:o make (string)o model (string)o year (int)o weight (float or double)• have a default constructor• have a 4-argument constructor• should override the Equal() methodo Two MotorVehicle objects are equal if and only if they have thesame make, the same model, the same year, and the sameweight• should override the toString() method3. Derive the following 2 subclasses from the MotorVehicle class:a. A class named Truck. This class shouldi. have the following property• cargo_bed_size (float or double)ii. a constructor that conforms to the rules of constructors in thecontext of inheritanceiii. a method named printTruck() that just prints “This is a Truckobject”iv. overridden methods for the 4 methods in the abstract parentclass• The method implementations should just print simplemessages that have the word Truckv. should override the Equal() method• Two Truck objects are equal if and only if they have thesame properties as in the parent class plus the samecargo_bed_sizevi. should override the toString() methodPage 4 of 4b. A class named SportsCar. This class shouldi. have the following property• zero_to_60_time (float or double) [this is measure ofhow fast a car accelerates]ii. a constructor that conforms to the rules of constructors in thecontext of inheritanceiii. a method named printSportsCar() that just prints “This is aSportsCar object”iv. overridden methods for the 4 methods in the abstract parentclass• The method implementations should just print simplemessages that have the word SportsCar.v. should override the Equal() method• Two SportsCar objects are equal if and only if they havethe same properties as in the parent class plus the samezero_to_60_timevi. should override the toString() method

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a console-based C# app that uses the concept of
inheritance to model motor vehicles as follows:
1. Define an abstract class named MotorVehicles that has the following four
abstract methods:
a. void driveForward()
b. void stop()
c. void driveBackward()
d. void turn(string direction)
2. This abstract class should:
• have the following properties:
o make (string)
o model (string)
o year (int)
o weight (float or double)
• have a default constructor
• have a 4-argument constructor
• should override the Equal() method
o Two MotorVehicle objects are equal if and only if they have the
same make, the same model, the same year, and the same
weight
• should override the toString() method
3. Derive the following 2 subclasses from the MotorVehicle class:
a. A class named Truck. This class should
i. have the following property
• cargo_bed_size (float or double)
ii. a constructor that conforms to the rules of constructors in the
context of inheritance
iii. a method named printTruck() that just prints “This is a Truck
object”
iv. overridden methods for the 4 methods in the abstract parent
class
• The method implementations should just print simple
messages that have the word Truck
v. should override the Equal() method
• Two Truck objects are equal if and only if they have the
same properties as in the parent class plus the same
cargo_bed_size
vi. should override the toString() method
Page 4 of 4
b. A class named SportsCar. This class should
i. have the following property
• zero_to_60_time (float or double) [this is measure of
how fast a car accelerates]
ii. a constructor that conforms to the rules of constructors in the
context of inheritance
iii. a method named printSportsCar() that just prints “This is a
SportsCar object”
iv. overridden methods for the 4 methods in the abstract parent
class
• The method implementations should just print simple
messages that have the word SportsCar.
v. should override the Equal() method
• Two SportsCar objects are equal if and only if they have
the same properties as in the parent class plus the same
zero_to_60_time
vi. should override the toString() method 

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education