Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package proj27012023;
- import java.util.Scanner;
- import unit4.bucketLib.Bucket;
- public class TestBucket {
- public static void main(String[] args) {
- Bucket b1 = new Bucket(10, "B1");
- b1.fill(7);
- Bucket b2 = new Bucket(3, "B2");
- b1.pourInto(b2);
- b2.pourInto(b1);
- Scanner in = new Scanner(System.in);
- int capacity;
- double amount;
- System.out.print("Enter capacity: ");
- capacity = in.nextInt();
- System.out.print("Enter amount: ");
- amount = in.nextDouble();
- Bucket b3 = new Bucket(capacity, "BBB");
- b3.fill(amount);
- System.out.println("empty=" + (b3.getCapacity() - b3.getCurrentAmount()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement