Here's a start:
Code:
class MyJava {
private int noBags = 0;
private int largeBoxes = 0;
private int mediumBoxes = 0;
private int smallBoxes = 0;
private int totPrice = 0;
public MyJava(int n) {
this.noBags = n;
}
public int price() {
// return something
}
public int numLgBoxes() {
// return something
}
public int numMedBoxes() {
// return something
}
public int numSmBoxes() {
// return something
}
public int totalPrice() {
// return something
}
}
Don't use the same variable- and method names. So if the method is called numLgBoxes don't use the same name for a variable.
Bookmarks