Question: PROBLEM Create a C# console-based project, a class representing a Plane, and implement the following requirements: Class: Plane Properties (auto-implemented): Manufactory: string Model: string Capacity:

PROBLEM

Create a C# console-based project, a class representing a Plane, and implement the following requirements:

Class: Plane

Properties (auto-implemented):

Manufactory: string

Model: string

Capacity: int

Type: string (can be cargo, military or passenger)

SerialNumber: string

Constructors:

A default constructor that sets the manufactory and model to unknown, the capacity to 0, the type to unassigned, and the serial number to 00000.

A constructor that takes in 5 arguments: manufactory, model, capacity, type, and serial number, and sets the corresponding properties.

Methods:

HasCapacity: a method that takes in an int argument for number of people and returns a boolean. The method should return True if the argument of the method is less than or equal to the capacity of the plane and False if the argument is greater than the capacity of the plane.

Override the ToString method to return a string representation of the Plane in the format:

Manufactory: [manufactory], Model: [model], Capacity: [capacity], Type: [type], Serial Number: [serial number]

Test Harness:

Create a List of Plane objects, with 5 planes in the Main() method of your Program class.

Loop through the list and print the ToString() of each plane.

Test the HasCapacity method with different number of people and print the result.

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!