Code error
I can't figure this one out and I'm new to Java programming and it reads:
public class MyCoffee
{
// creates a new Coffee instance
private String MyBrand;
private String MyStrength;
private double MyPrice;
// private double MyPrice;
// private String SetMyStrength;
// private String SetMyBrand;
public MyCoffee (String MyBrand, String Strength, double MyPrice){
SetMyBrand = MyBrand; // initializes MyBrand
SetMyStrength = MyStrength; // initializes MyStrength
double MyPrice = MyPrice; // initialized MyPrice
}
// constructor initializes MyBrand with String supplied as argument
public MyCoffee( String name )
{
MyBrand = Brand; // initializes MyBrand
MyStrength = Strenght; // initializes MyStrength
double MyPrice = MyPrice; // initializes MyPrice
} // end constructor
// method to set the variables
public void setMyCoffee( String MyBrand )
{
setMyBrand = MyBrand; // stores MyBrand
setMyStrength = MyStrength; //stores MyStrength
setMyPrice = MyPrice;
} // end method setMyCoffee
// method to retrieve MyCoffee
public String getMyBrand()
{
return MyBrand();
return MyStrength();
return double MyPrice()
} // end method getMyBrand
// display a welcome message to the MyCoffee user
public void displayGetMethod()
{
// calls for getMyBrand to get the
// name of MyCoffee
getMyBrand();
getMyStrength();
getMyPrice();
}
// constructor should initialize the call
public static void main(String arg[])
{
coffee.setBrand(Starbucks);
coffee.setPrice(1.0);
Coffee coffee = new Coffee ("Starbucks", "Strong", 10.00);
System.out.println("Select from these Choices");
System.out.println(MyBrand + coffee.getMyBrand());
System.out.println(MyStrength, + coffee.getStrength());
System.out.println(MyPrice, + coffee.getMyPrice());
// end display Getmethod
}
} // end class MyCoffee

