Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions