# lab7_113 - children and all pieces of luggage in that...

This preview shows page 1. Sign up to view the full content.

KSU / CCIS / CS DEPARTMENT CSC-113, SPRING 2010 LAB 7 – INTERFACE AND ABSTRACT CLASSES An airport charges any airplane lands in it by the following rules: 1. Every adult is charged 2 S.R . for every kilogram they weigh. 2. Every child is charged 0.5 S.R for every kilogram they weigh. 3. Every piece of luggage is charged 1.5 S.R . for every kilogram it weighs. Every passenger has a name and a weight and every piece of luggage has an ID and weight. Given the UML diagram of this problem, write a program that process one airplane and display the information (name/ID, weight and charge) of the luggage or the passengers that cost a charge of more than 50 S.R. Also, print the number of all adults, all
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: children and all pieces of luggage in that airplane. While you are implementing your program, consider the following: -Protect any method that is not intended to be overridden, from being overridden by subclasses. -Protect any concrete class from being inherited. Hint: Represent an airplane as a collection (array) of Chargeable Objects. Part of the main… chargeables[0]= new Child("Ahmed Ali",45.5); chargeables[1]= new Adult("Khalid Nasser",86.4); chargeables[2]= new Child("Noha Ameen",62); chargeables[3]= new Luggage(324,35.5); chargeables[4]= new Adult("Salem Saeed",94.25);...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online