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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started