CMSC 10600 Fundamentals of Computer Programming 2
Winter 2002 --- N. Russo and S. Salveter

Homework 7

Inheritance and Polymorphism

Due Friday 1 March 2002

This week you are going to simulate a domain of airports and aircraft.

An airport has only two attributes: wind speed (mph) and runway length (feet).

There are three kinds of aircraft: planes, helicopters and shuttles. All aircraft have a weight (int), an ID (string), and a member function bool canLand(Airport *ap) that returns whether the aircraft can land at a given airport.

A plane can land at an airport if there is at least one foot of runway for every 25 pounds of its weight, andthe wind speed does not exceed 30 mph.

A helicopter can land at an airport if the wind speed does not exceed 20 mph.

A shuttle can land at an airport if the runway length, in feet, is greater than one thousand times the wind speed, in mph. All shuttles weigh 200,000.

Of course, all your output should be beautifully organized and labeled.

Turn in your program in the usual way, as described in Instructions for Handing in Assignments.