|
Please help
What is the problem here
import java.io.*;
/**
* Pizza.java
* Stores the information for one pizza.
*/
class Pizza
{
public static final String[] SIZES = {"small", "medium", "large"};
// Different pizza sizes.
private Toppings toppings;
private String size;
/**
* Constructor of "old" pizzas (from the load file).
* @param s Pizza size.
* @param t List of toppings.
*/
public Pizza(String s, String t)
{
size = s;
toppings = new Toppings(t);
}
/**
* Constructor of new pizzas.
*/
public Pizza()
{
}
/**
* Get this pizza's size.
* @return The size of a pizza.
*/
public String getSize()
{
return size;
}
/**
* Input the pizza size.
*/
public void setSize() throws IOException
{
size = SIZES[InputOutputOperations.pickOption("Input a choice", SIZES)];
}
/**
* Input the toppings for this pizza.
*/
public void setToppings() throws IOException
{
toppings = new Toppings();
toppings.setToppings(InputOutputOperations.pickCho ices("Input choices", Toppings.TOPPINGS_LIST));
}
/**
* Get the toppings for this pizza.
* @return The toppings for this pizza.
*/
public Toppings getToppings()
{
return toppings;
}
/**
* Get a string representation of this pizza.
* @return Representation of pizza.
*/
public String toString()
{
return size + toppings;
}
/**
* Get the price of this pizza.
* @return Price of pizza.
*/
public double getPrice()
{
double total = 0;
if(size.equals("small"))
total = 11.99;
else if(size.equals("medium"))
total = 14.99;
else
total = 16.99;
int count = toppings.getNumberOfToppings();
if(count > 3)
total = total + (count - 3) * 1.00;
return total;
}
}
Error
Toppings toppings; cannot find symbol
|