SHARE
TWEET

Untitled

a guest Nov 19th, 2013 34 Never
  1. public class WarehouseDriver {
  2.  
  3.     public static void main(String[] args) {
  4.         // 3 objects created
  5.         Warehouse whOne = new Warehouse(212, 65, 75);
  6.         Warehouse whTwo = new Warehouse(55, 170);
  7.         Warehouse whThree = new Warehouse();
  8.  
  9.         System.out.println("Warehouse 1 contents:\n" + whOne);
  10.         System.out.println("Warehouse 2 contents:\n" + whTwo);
  11.         System.out.println("Warehouse 3 contents:\n" + whThree);
  12.  
  13.         whOne.addRadio(15);
  14.         whOne.addTV(6);
  15.         whOne.addComputer(30);
  16.         whTwo.addRadio(40);
  17.         whTwo.addComputer(17);
  18.         whTwo.addRadio(23);
  19.         whThree.addRadio(13);
  20.         whThree.addTV(123);
  21.         whThree.addComputer(49);
  22.  
  23.         System.out.println("Warehouse 1 contents:\n" + whOne);
  24.         System.out.println("Warehouse 2 contents:\n" + whTwo);
  25.         System.out.println("Warehouse 3 contents:\n" + whThree);
  26.        
  27.  
  28.         whOne.removeRadio(55);
  29.         whOne.removeTV(71);
  30.         whOne.removeComputer(19);
  31.         whTwo.removeRadio(12);
  32.         whTwo.removeTV(94);
  33.         whTwo.removeComputer(39);
  34.         whThree.removeRadio(22);
  35.         whThree.removeTV(7);
  36.         whThree.removeComputer(52);
  37.  
  38.         System.out.println("Warehouse 1 contents:\n" + whOne);
  39.         System.out.println("Warehouse 2 contents:\n" + whTwo);
  40.         System.out.println("Warehouse 3 contents:\n" + whThree);
  41.     }
  42. }
RAW Paste Data
Top