Ejemplo n.º 1
0
		public PetStore()
		{

			purchaseOrders = new Hashtable();
			accounts = new Hashtable();

			Item[] items;
			Product[] products;
		
			categories = new Category[5];
		
			products = new Product[2];
			items = new Item[] {new Item("Adult Male Amazon Parrot", "Great companion for up to 75 years", "/images/parrot.jpg", 193.50d, 92.00d)};
			products[0] = new Product("Amazon Parrot","Great companion for up to 75 years", items);
			items = new Item[] {new Item("Adult Male Finch", "Great stress reliever", "/images/finch.jpg", 15.50d, 2.00d)};
			products[1] = new Product("Finch", "Great stress reliever", items);
			categories[0] = new Category("Birds", products);
		
			products = new Product[2];
			items = new Item[] {new Item("Tailless Manx", "Great for reducing mouse populations", "/images/manx.jpg", 58.50d, 12.00d), new Item("With tail Manx", "Great for reducing mouse populations", "/images/manx.jpg", 23.50d, 12.00d)};
			products[0] = new Product("Manx", "Great for reducing mouse populations", items);
			items = new Item[] {new Item("Adult Female Persian", "Friendly house cat, doubles as a princess", "/images/persian.jpg", 93.50d, 12.00d), new Item("Adult Male Persian", "Friendly house cat, doubles as a prince", "/images/persian.jpg", 93.50d, 12.00d)};
			products[1] = new Product("Persian", "Friendly house cat, doubles as a princess", items);
			categories[1] = new Category("Cats", products);
	
			products = new Product[2];
			items = new Item[] {new Item("Male Adult Bulldog", "Friendly dog from England", "/images/bulldog.jpg", 18.50d, 12.00d), new Item("Female Puppy Bulldog", "Friendly dog from England", "/images/bulldog.jpg", 18.50d, 12.00d)};
			products[0] = new Product("Bulldog", "Friendly dog from England", items);
			items = new Item[] {new Item("Adult Male Chihuahua", "Little yapper", "/images/chihuahua.jpg", 125.50d, 92.00d), new Item("Adult Female Chihuahua", "Great companion dog", "/images/chihuahua.jpg", 155.29d, 90.00d)};
			products[1] = new Product("Chihuahua", "Great companion dog", items);
			categories[2] = new Category("Dogs", products);
	
			products = new Product[2];
			items = new Item[] {new Item("Large Angelfish", "Fresh Water fish from Japan", "/images/angelFish.jpg", 16.50d, 10.00d), new Item("Small Angelfish", "Fresh Water fish from Japan", "/images/angelFish.jpg", 16.50d, 10.00d)};
			products[0] = new Product("Angelfish", "Salt Water fish from Australia", items);
			items = new Item[] {new Item("Adult Male Goldfish", "Fresh Water fish from China", "/images/goldfish.jpg", 5.50d, 2.00d), new Item("Adult Female Goldfish", "Fresh Water fish from China", "/images/goldfish.jpg", 5.29d, 1.00d)};
			products[1] = new Product("Goldfish", "Fresh Water fish from China", items);
			categories[3] = new Category("Fish", products);
	
			products = new Product[2];
			items = new Item[] {new Item("Green Adult Iguana", "Friendly green friend", "/images/iguana.jpg", 12.50d, 11.10d)};
			products[0] = new Product("Iguana", "Friendly green friend", items);
			items = new Item[] {new Item("Venomless Rattlesnake", "More Bark than bite", "/images/rattlesnake.jpg", 18.50d, 12.00d), new Item("Rattleless Rattlesnake", "Doubles as a watch dog", "/images/rattlesnake.jpg", 18.50d, 12.00d)};
			products[1] = new Product("Rattlesnake", "Doubles as a watch dog", items);
			categories[4] = new Category("Reptiles", products);

		}
Ejemplo n.º 2
0
		public Category(String name, Product[] products) 
		{
			this.name = name;
			this.products = products;
		}