Untitled


SUBMITTED BY: Guest

DATE: Jan. 17, 2015, 10:49 a.m.

FORMAT: Java

SIZE: 1.3 kB

HITS: 948

  1. public class Main {
  2. static Vector<Chain> chains = new Vector<Chain>();//Check unique name
  3. static Vector<Mall> malls = new Vector<Mall>();//Check unique number
  4. static ExceptionFunctions ex = new ExceptionFunctions();
  5. public static void main(String[] args)
  6. {
  7. try{
  8. malls.add(new Mall("Hilel", 212));
  9. malls.get(0).addShop(new Shop("Shuper", 2));
  10. malls.get(0).addShop(new Shop("George", 42));
  11. malls.add(new Mall("Hasharon", 432));
  12. malls.get(1).addShop(new Shop("Columbus", 12));
  13. malls.get(1).addShop(new Shop("Bastro", 65));
  14. malls.get(1).addShop(new Shop("George", 81));
  15. chains.add(new ClothesChain("Bastro","Moshe"));
  16. chains.get(0).addShop(malls.get(1).getShop(65));
  17. chains.add(new FoodChain("Columbus",3));
  18. chains.get(1).addShop(malls.get(1).getShop(12));
  19. chains.add(new FastFoodChain("George",35,25,1));
  20. chains.get(2).addShop(malls.get(0).getShop(42));
  21. chains.get(2).addShop(malls.get(1).getShop(81));
  22. chains.add(new BookChain("Shuper","C++ programming is fun"));
  23. chains.get(3).addShop(malls.get(0).getShop(2));
  24. }
  25. catch(Exception e)
  26. {
  27. System.out.println(e.getMessage());
  28. }
  29. }

comments powered by Disqus