Maha

Maha

  • NA
  • 0
  • 312k

NP39 Position of the DisplayFleet() method

Sep 7 2007 2:59 PM

September 7, 2007

 

Hi Guys

 

NP39   Position of the DisplayFleet() method     

 

I got the following question from the book.

 

In the question 1st author is talking about DisplayFleet() method then about Main() method and finally again DisplayFleet() method what author is saying she wants DisplayFleet() method both within the Car class and Main() method or only within the Main() method. Please help.

 

Thank you

 

Create a class named Car containing fields that hold a vehicle ID number, make, model, color, and value for a Car object. Include appropriate get and set methods for each field. Write a DisplayFleet( ) method that accepts any number of Car objects, displays their values, and displays the total value of all Car objects passed to the method. Write a Main( ) method that declares five Car objects and assigns values to each, then calls DisplayFleet ( ) three times—passing three, four, and five Car objects in successive calls. Save the program as Car.es.


Answers (4)