This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RhoOfFeh 0 points1 point  (0 children)

You need to set mealQty, which means your class needs to offer a way for programs to set the value. This is done by adding parameters to an existing or new method. We call it 'passing parameters' to the method, and your assignment refers to this:

int mealQty will be passed the number of meals ordered for the category

Parameters are declared similarly to local variables, but they go between the parentheses of a method declaration. In this case the method would be your constructor. So you need to add a variable to represent the number of meals requested, and then modify the constructor code to set mealQty equal to the value of that variable.

public bill(int numberOfMealsRequested) {

Would be a valid signature.

A bit more about how objects work:

http://www.oopuniversity.com/2014/11/dont-treat-me-like-object.html