Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!