Hi, i have a hw assignment and i need help. I have done the first class already which is the city class. Heres what i got:
public class cityclass{
private String cityname;
private int days;
private double cost;
private float rating;
public cityclass(String newcityname, int newdays, double newcost, float newrating)
{
this.cityname = newcityname;
this.days = newdays;
this.cost = newcost;
this.rating = newrating;
}
public void setcityname(String newcityname)
{
this.cityname = newcityname;
}
public void setdays(int newdays)
{
this.days = newdays;
}
public void setcost(double newcost)
{
this.cost = newcost;
}
public void setrating(int newrating)
{
this.rating = newrating;
}
public String getcityname()
{
return this.cityname;
}
public int getdays()
{
return this.days;
}
public double getcost()
{
return this.cost;
}
public float getrating()
{
return this.rating;
}
public String howGood()
{
return null;
}
public void print()
{
System.out.print("CityName: " + this.cityname + " Days" + this.days + "cost" + this.cost + "Rating"+ this.rating);
}
}