The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
February 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

URGENT HELP NEEDED

Posted by ADIL on February 08, 2001 at 12:59 PM

HI I WOULD BE REALLY GRATEFUL IF YOU CAN HELP ME WITH THE FOLLOEING TASKS.
I NEED THE ANSWERS FOR THE FOLLOWING TASKS BY WEDNEDAY THE 14th OF FEBRUARY.
I WOULD BE REALLY GRATEFUL IF YOU COULD HELP ME BY ANSWERING IT AND SENDING IT TO ME ON THE EMAIL ADDRESS BELOW

adn1@dcs.qmw.ac.uk

A class called Vehicle is required by a programmer who is writing
software for a car dealer. An object of the class Vehicle will
consist of a registration number, the make of the vehicle, the
year of manufacture and the current value of the vehicle.

Methods should be provided to read each of these values from an object.
There should also be a method which accepts a year as input, and returns
the age of the vehicle.

First, design and code the class Vehicle.

Second, design and code a subclass called SecondHand Vehicle.
This subclass should have an attribute (and method) that keeps track
of the number of owners it has had. In this method, override
the method that returns age, so that it returns the average
amount of time it has served with each owner.

Third, write a menu-driven program that offers the following options:
1. Add a vehicle
2. display a list of vehicle details, including age/owners.
3. delete a vehicle
4. quit

When you add a vehicle you should let the user decide whether it
is second hand or not.


ONCE AGAIN THANK YOU AND I HOPE THAT YOU CAN HELP ME VERY SOON.


ADIL




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us