February 26, 2017

Homework Help: Object Oriented Programming

Posted by 7/7/77 on Wednesday, April 4, 2012 at 5:24pm.

Write an application class that generates 6 objects randomly from either a Car, or a Truck, or a Bicycle class. Your generated objects will be stored in a RentedVehicle array.
Write a static method in your test class that takes an array of RentedVehicles and prints the following for each element of the array:
• if the object is a car print its name and the number of seats and cost.
• if it is a Truck, print its name and capacity and cost.
• if it is a Bicycle, print its name and how many days it is rented and cost.

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions