import javax.swing.JOptionPane;
public class Car
{
//*******************************************************
//Declaration of instance variables/fields of the class
//*******************************************************
private String make, color;
private int year, topSpeed;
private boolean availability;
private double stickerPrice, discount, tax;
public Car()
{
make = "";
color = "";
year = 0;
topSpeed = 0;
availability = true;
stickerPrice = 0;
discount = 0;
}
public Car(String make1, String color1, int year1, int topSpeed1, boolean availability1, double stickerPrice1, double tax1, double discount1)
{
make = make1;
color = color1;
year = year1;
topSpeed = topSpeed1;
availability = availability1;
stickerPrice = stickerPrice1;
tax = tax1;
discount = discount1;
}
//***********************************************************
//getMake()
//This method will get the make of the car.
//***********************************************************
public String getMake()
{
return make;
}
//***********************************************************
//setMake(String make)
//This method will set the make of the car.
//***********************************************************
public void setMake(String make1)
{
make = make1;
}
//***********************************************************
//getColor()
//This method will get the color of the car.
//***********************************************************
public String getColor()
{
return color;
}
//***********************************************************
//setColor(String color)
//This method will set the color of the car.
//***********************************************************
public void setColor(String color1)
{
color = color1;
}
//***********************************************************
//getYear()
//This method will get the year that the car was made.
//***********************************************************
public int getYear()
{
return year;
}
//***********************************************************
//setYear(int year1)
//This method will set the year in which the car was made.
//***********************************************************
public void setYear(int year1)
{
year = year1;
}
//***********************************************************
//getTopSpeed()
//This method will get the top speed of the car.
//***********************************************************
public int getTopSpeed()
{
return topSpeed;
}
//***********************************************************
//setTopSpeed(int topSpeed1)
//This method will set the top speed of the car.
//***********************************************************
public void setTopSpeed(int topSpeed1)
{
topSpeed = topSpeed1;
}
//***********************************************************
//getAvailability()
//This method will get the availabilty of the car.
//***********************************************************
public boolean getAvailability()
{
return availability;
}
//***********************************************************
//setMake(String make)
//This method will set the make of the car.
//***********************************************************
public void setAvailability(boolean availability1)
{
availability = availability1;
}
//***********************************************************
//getStickerPrice()
//This method will get the sticker price of the car.
//***********************************************************
public double getStickerPrice()
{
return stickerPrice;
}
//***********************************************************
//setStickerPrice(double stickerPrice)
//This method will set the sticker price of the car.
//***********************************************************
public void setStickerPrice(double stickerPrice1)
{
stickerPrice = stickerPrice1;
}
//***********************************************************
//getTax()
//This method will get the tax on the car.
//***********************************************************
public double getTax()
{
return tax;
}
//***********************************************************
//setMake(String make)
//This method will set the tax on the car.
//***********************************************************
public void setTax(double tax1)
{
tax = tax1;
}
//***********************************************************
//getDiscount()
//This method will get the discount on the car.
//***********************************************************
public double getDiscount()
{
return discount;
}
//***********************************************************
//setDiscount(double discount1)
//This method will set the discount on the car.
//***********************************************************
public void setDiscount(double discount1)
{
discount = discount1;
}
//************************************************************
//used()
//This method if the car is used or not.
//************************************************************
public void used(int year)
{
if (year < 2009)
{
JOptionPane.showMessageDialog("The car is used.");
}
else
JOptionPane.showMessageDialog("The car is new.");
}
//***************************************************************
//discount(int percentOff)
//This method puts a discount on the sticker price.
//***************************************************************
public double discount(int percentOff)
{
percentOff *= .01;
stickerPrice = (stickerPrice*percentOff);
return stickerPrice;
}
public double totalCost(int stickerPrice, int discount)
{
}
}