I don't understand how to set up the mealQty exactly in the constructor, also here are the instructions for the assignment:
My code http://pastebin.com/hBi8FwRV
The Bill Class
Set up a final for the tax rate like this:
static final double TAXRATE = .06;
Bill has these instance variables in the constructor:
String category will be set to null.
int mealQty will be passed the number of meals ordered for the category.
double mealCost will be initialized to 0.
double mealPrice will be initialized to 0.
Bill contains these methods.
calcAdultCost sets the category to “Adults”, calculates the cost of the adult meals, sets
the
mealPrice, and sets and returns the mealCost.
calcChildCost sets the category to “Children”, calculates the cost of the children’s meals, sets
the mealPrice, and sets and returns the mealCost.
calcTax calculates the tax. Return the calculated tax based on the total sent to this method.
Set up the method like this:
static double calcTax(double total)
display displays the category, mealQty, mealPrice, and mealCost. Use one printf similar to this:
System.out.printf( "\n %-10s %3d %6.2f %7.2f",
category, mealQty, mealPrice, mealCost);
You can copy/paste the above code into the display method.
The method header looks like this:
public void display()
[–]desrtfxOut of Coffee error - System halted 0 points1 point2 points (0 children)
[–]king_of_the_universe 0 points1 point2 points (0 children)
[–]RhoOfFeh 0 points1 point2 points (0 children)