The ParkedCar class - This class should simulate a parked car. The c.docx - The ParkedCar class This class should simulate a parked car The classes

The ParkedCar class - This class should simulate a parked car. The c.docx

This preview shows page 2 - 5 out of 15 pages.

The ParkedCar class - This class should simulate a parked car. The classes responsiblities are as follows:-To know the car's make, model, color, license number, and the number of minutes that the car has been parked.public class ParkedCar{/* Fields simulating a parked car. The classes responsiblitiesare as follows:-To know the car's make, model, color, license number, and the number of minutes that the car has been parked*/private String model; //model of carprivate String color; //color of carprivate String licenseNumber;//license number of carprivate double numOfMinPark;//number of minutes that the car has been parked/**Constructor@param mod the model of car@param col the color of car@param lic the license number of car@param nOmP the number of minutes that the car has been parked*/
Background image
public ParkedCar(String mod, String col, String lic,double nOmP){model = mod;color= col;licenseNumber = lic;numOfMinPark= nOmP;}/**The copy constructor initializes the objectas a copy of another parkedCar object.@param object2 The object to copy*/public ParkedCar(ParkedCar object2){model = object2.model;color=object2.color;licenseNumber = object2.licenseNumber;numOfMinPark= object2.numOfMinPark;}/**The setModel method sets the cars model@param mod the model*/public void setModel(String mod)
Background image
{model= mod;}/**The setColor method sets the color of the car@param col the color*/public void setColor(String col){color = col;}/**The setliceneNumber method sets the employee hourly pay rate@param lic the licene number*/public void setliceneNumber(String lic){licenseNumber= lic;}/**The setNumOfMinPark method sets the number of minutes that the car has been parked@param nOmP the number of minutes parked
Background image
Image of page 5

You've reached the end of your free preview.

Want to read all 15 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes