Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C#: Create 3 classes all in the C_Workshop namespace, all three classes will not be limited in their scope The first class will be

Using C#:

Create 3 classes all in the C_Workshop namespace, all three classes will not be limited in their scope

The first class will be called Car o In the Car class make a new property with only an accessor to get the value but not an accessor to set the value, do not limit its scope.

o This property will hold true or false values and be used to determine if the Car has automatic or manual transmission

o Create a constructor for the class that does not have a limited scope

The constructor will take two parameters, one to set the property we created on this class and the other to be used to assign our FuelType

In the constructor, use the first parameter to set our property and the second parameter set our FuelType (Do not create this FuelType property or field in this car class, it should be inherited from vehicle already!)

If the FuelType is set to Gas, set the properties of the cost of traveling and the initial cost of using the vehicle. (these should be set to have the cheapest values)

If the FuelType is set to Electric, set the properties of cost of traveling and initial cost of using the vehicle to something different than the FuelType of Gas (Second cheapest values)

Any other FuelTypes, default the cost of travling and initial cost to the values you want

Set the Name in the constructor to whatever you want

Set the MaxOccupancy of this vehicle to whatever you want as well

The second class will be called Rail o In the Rail class make a new property with only an accessor to get the value but not an accessor to set the value, do not limit its scope.

o This property will hold whole values and be used to determine the amount of people working on the Rail

o Create a constructor for the class that does not have a limited scope

The constructor will take two parameters, one to set the property we created on this class and the other to be used to assign our FuelType

In the constructor, use the first parameter to set our property we created and the second parameter to set our FuelType (Do not create this FuelType property or field in this Rail class, it should be inherited from Vehicle!)

If the FuelType is set to Coal, set the properties of cost of traveling and initial cost of using the vehicle to something (This should have the cheapest values)

If the FuelType is set to Gas, set the properties of the cost of traveling and the initial cost of using the vehicle, different than the FuelType of Coal (Second cheapest values)

Any other FuelTypes, default the cost of travling and initial cost to the values you want (Most expensive values used here)

Set the Name in the constructor to whatever you want

Set the MaxOccupancy of this vehicle to whatever you want as well

The third class will be called Airplane o In the Airplane class make a new property with only an accessor to get the value but not an accessor to set the value, do not limit its scope.

o This property will hold whole values and be used to determine the amount of people working on the Airplane

o Also, create another property that does not have a limited scope but does have a scope on the accessor to set the property that is limited to only the Airplane class. This property will hold string values

o Create a constructor for the class that does not have a limited scope

The constructor will take three parameters, one to set the property we created on this class for the amount of people working on the Airplane, one to set the property name of the airline and the other to be used to assign our FuelType

In the constructor, use the parameters to set our properties accordingly and to set our FuelType (Do not create this FuelType property or field in this Airplane class, it should be inherited from Vehicle!)

If the FuelType is set to Gas, set the properties of cost of traveling and initial cost of using the vehicle to something (This should have the cheapest values)

If the FuelType is set to Electric, set the properties of the cost of traveling and the initial cost of using the vehicle, different than the FuelType of Gas (Second cheapest values)

Any other FuelTypes, default the cost of travling and initial cost to the values you want (Most expensive values used here)

Set the Name in the constructor to whatever you want

Set the MaxOccupancy of this vehicle to whatever you want as well

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago