Advertisement
calcpage

C4X10_Balloon.java

Oct 20th, 2011
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. //Balloon.java      MrG 2011.1020
  2. public class Balloon
  3. {
  4.     private double air;
  5.    
  6.     /**
  7.     Constructor: initialize the volume
  8.     */
  9.     public Balloon()
  10.     {
  11.         air=0;
  12.     }
  13.  
  14.     /**
  15.     Accessor: returns volume
  16.     @return the volume
  17.     */
  18.     public double getVolume()
  19.     {
  20.         return air;
  21.     }
  22.  
  23.     /**
  24.     Mutator: modifies volume
  25.     @param amt is how much you blow
  26.     */
  27.     public void addAir(double amt)
  28.     {
  29.         air=air+amt;
  30.     }
  31.  
  32.     /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement