36 lines
636 B
Java
36 lines
636 B
Java
public class Plant{
|
|
protected String name, cost;
|
|
|
|
public Plant(){
|
|
this.name = "No Name";
|
|
this.cost = "0.0";
|
|
}
|
|
/* public Plant(String name, String cost){
|
|
this.name = name;
|
|
this.cost = Double.parseDouble(cost);
|
|
}
|
|
*/
|
|
|
|
public void printInfo(){
|
|
System.out.println("Plant Information:");
|
|
System.out.println("\tPlant name: " + name);
|
|
System.out.println("\tCost: " + cost + "\n");
|
|
}
|
|
|
|
public void setPlantName(String name){
|
|
this.name = name;
|
|
}
|
|
|
|
public String getPlantName(){
|
|
return this.name;
|
|
}
|
|
|
|
public void setPlantCost(String cost){
|
|
this.cost = cost;
|
|
}
|
|
public String getPlantCost(){
|
|
return this.cost;
|
|
}
|
|
|
|
}
|