So i have my 1st project due tommrow and im having some trouble creating a bottle class. here are the instructions
Write a bottle class. The class has read(), set(int), set(bottle), add(bottle), subtract(bottle), multiply(bottle), divide(bottle), add(int), subtract(int), multiply(int), divide(int), equals(bottles), and toString() methods.
here is the BotteDemo
import java.util.Scanner;
// test driver for the Bottle class
public class BottleDemo
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int x;
Bottle bottle1 = new Bottle();
Bottle bottle2 = new Bottle();
Bottle bottle3 = new Bottle();
Bottle bottle4 = new Bottle();
Bottle bottleAve = new Bottle();
System.out.println("please enter a number for bottle1:");
bottle1.read();
System.out.println("bottle1 is this value " + bottle1);
System.out.println("please enter a number for bottle2:");
bottle2.read();
System.out.println("please enter a number for bottle3:");
bottle3.read();
System.out.println("please enter a number for bottle4:");
bottle4.read();
bottleAve = bottleAve.add(bottle1);
bottleAve = bottleAve.add(bottle2);
bottleAve = bottleAve.add(bottle3);
bottleAve = bottleAve.add(bottle4);
bottleAve = bottleAve.divide(4);
System.out.println("the average of the 4 bottles is: " +
bottleAve);
if (bottle1.equals(bottle3))
{
System.out.println("bottle1 and bottle3 are equal");
}
else
{
System.out.println("bottle1 and bottle3 are not equal");
}
System.out.println("Eenter an integer to add to bottle 1");
x = scan.nextInt();
bottle1.add(x);
System.out.println("adding your number " + x +
" to bottle1 gives " + bottle1);
bottle2 = bottle1.add(bottle3);
System.out.println("adding the number “ + bottle3 + “ from
bottle3 to bottle1 gives " + bottle2);
}
}

