///////////////////////////////////////////////////////////////////////////////////// // File: soda.java class Soda { String brand; int size; // in oz int price; // in cents Soda (String brand, int size, int price){ this.brand = brand; this.size = size; this.price = price; } // Template // ...this.brand... // ...this.size... // ...this.price... // ...this.isBig()... // ...this.sameBrand(String aBrand)... // determine whether this soda is a big one (over 16 oz) boolean isBig(){ return this.size > 16; } // determine whether this soda is the same brand as the given brand boolean sameBrand(String aBrand){ return ((this.brand).compareTo(aBrand)) == 0; } } // Soda coke = new Soda("Coca Cola Classic", 20, 160); // Soda sprite = new Soda("Sprite", 20, 160); // Soda dsprite = new Soda("Diet Sprite", 12, 120); // Soda dasani = new Soda("Dasani Water", 16, 240); // "Testing the methods in the Soda class" // dsprite.isBig() == false // coke.isBig() == true // coke.sameBrand("coke") == false // coke.sameBrand("Coca Cola Classic") == true