Ok here's my problem....again. This is the only way i know how to do this so don't be disgusted at my coding.
public class ReOrderList { public static void printDetails(Food CheddarCheese, Food DanishBlueCheese, Food BlackOlives, Food GreenOlives, Stationary BlueBiro, Stationary RedBiro, Stationary SpiralNotebook, Cleaning Shampoo, Cleaning ShowerGel) { System.out.println("Welcome to the automatic re-order.\nThis program will tell you if we need items or if we dont." + " Any items needed will automatically update.\n"); if(CheddarCheese.getQtyInStock() > CheddarCheese.getReOrderPoint()) { System.out.println("We dont need to order any " + CheddarCheese.getDescription()); } else if(CheddarCheese.getQtyInStock() <= CheddarCheese.getReOrderPoint()) { System.out.println("We need to order " + (CheddarCheese.getMaxNum() - CheddarCheese.getQtyInStock()) + " more " + CheddarCheese.getDescription() + "."); CheddarCheese.setNewQtyInStock(CheddarCheese.getMaxNum()); } if(DanishBlueCheese.getQtyInStock() > DanishBlueCheese.getReOrderPoint()) { System.out.println("We dont need to order any " + DanishBlueCheese.getDescription()); } else if(DanishBlueCheese.getQtyInStock() <= DanishBlueCheese.getReOrderPoint()) { System.out.println("We need to order " + (DanishBlueCheese.getMaxNum() - DanishBlueCheese.getQtyInStock()) + " more " + DanishBlueCheese.getDescription() + "."); DanishBlueCheese.setNewQtyInStock(DanishBlueCheese.getMaxNum()); } if(BlackOlives.getQtyInStock() > BlackOlives.getReOrderPoint()) { System.out.println("We dont need to order any " + BlackOlives.getDescription()); } else if(BlackOlives.getQtyInStock() <= BlackOlives.getReOrderPoint()) { System.out.println("We need to order " + (BlackOlives.getMaxNum() - BlackOlives.getQtyInStock()) + " more " + BlackOlives.getDescription() + "."); BlackOlives.setNewQtyInStock(BlackOlives.getMaxNum()); } if(GreenOlives.getQtyInStock() > GreenOlives.getReOrderPoint()) { System.out.println("We dont need to order any " + GreenOlives.getDescription()); } else if(GreenOlives.getQtyInStock() <= GreenOlives.getReOrderPoint()) { System.out.println("We need to order " + (GreenOlives.getMaxNum() - GreenOlives.getQtyInStock()) + " more " + GreenOlives.getDescription() + "."); GreenOlives.setNewQtyInStock(GreenOlives.getMaxNum()); } if(BlueBiro.getQtyInStock() > BlueBiro.getReOrderPoint()) { System.out.println("We dont need to order any " + BlueBiro.getDescription()); } else if(BlueBiro.getQtyInStock() <= BlueBiro.getReOrderPoint()) { System.out.println("We need to order " + (BlueBiro.getMaxNum() - BlueBiro.getQtyInStock()) + " more " + BlueBiro.getDescription() + "."); BlueBiro.setNewQtyInStock(BlueBiro.getMaxNum()); } if(RedBiro.getQtyInStock() > RedBiro.getReOrderPoint()) { System.out.println("We dont need to order any " + RedBiro.getDescription()); } else if(RedBiro.getQtyInStock() <= RedBiro.getReOrderPoint()) { System.out.println("We need to order " + (RedBiro.getMaxNum() - RedBiro.getQtyInStock()) + " more " + RedBiro.getDescription() + "."); RedBiro.setNewQtyInStock(RedBiro.getMaxNum()); } if(SpiralNotebook.getQtyInStock() > SpiralNotebook.getReOrderPoint()) { System.out.println("We dont need to order any " + SpiralNotebook.getDescription()); } else if(SpiralNotebook.getQtyInStock() <= SpiralNotebook.getReOrderPoint()) { System.out.println("We need to order " + (SpiralNotebook.getMaxNum() - SpiralNotebook.getQtyInStock()) + " more " + SpiralNotebook.getDescription() + "."); SpiralNotebook.setNewQtyInStock(SpiralNotebook.getMaxNum()); } if(Shampoo.getQtyInStock() > Shampoo.getReOrderPoint()) { System.out.println("We dont need to order any " + Shampoo.getDescription()); } else if(Shampoo.getQtyInStock() <= Shampoo.getReOrderPoint()) { System.out.println("We need to order " + (Shampoo.getMaxNum() - Shampoo.getQtyInStock()) + " more " + Shampoo.getDescription() + "."); Shampoo.setNewQtyInStock(Shampoo.getMaxNum()); } if(ShowerGel.getQtyInStock() > ShowerGel.getReOrderPoint()) { System.out.println("We dont need to order any " + ShowerGel.getDescription()); } else if(ShowerGel.getQtyInStock() <= ShowerGel.getReOrderPoint()) { System.out.println("We need to order " + (ShowerGel.getMaxNum() - ShowerGel.getQtyInStock()) + " more " + ShowerGel.getDescription() + "."); ShowerGel.setNewQtyInStock(ShowerGel.getMaxNum()); } } }
The newQtyInStock is a variable in Store - the main class.
public class NewStockList { public static void printDetails(Food CheddarCheese, Food DanishBlueCheese, Food BlackOlives, Food GreenOlives, Stationary BlueBiro, Stationary RedBiro, Stationary SpiralNotebook, Cleaning Shampoo, Cleaning ShowerGel) { System.out.println(" New Stock List"); System.out.println("Part Code" + " Description" + " Quantity In Stock"); System.out.println(CheddarCheese.getPartCode() + " " + CheddarCheese.getDescription() + " " + CheddarCheese.getNewQtyInStock()); System.out.println(DanishBlueCheese.getPartCode() + " " + DanishBlueCheese.getDescription() + " " + DanishBlueCheese.getNewQtyInStock()); System.out.println(BlackOlives.getPartCode() + " " + BlackOlives.getDescription() + " " + BlackOlives.getNewQtyInStock()); System.out.println(GreenOlives.getPartCode() + " " + GreenOlives.getDescription() + " " + GreenOlives.getNewQtyInStock()); System.out.println(BlueBiro.getPartCode() + " " + BlueBiro.getDescription() + " " + BlueBiro.getNewQtyInStock()); System.out.println(RedBiro.getPartCode() + " " + RedBiro.getDescription() + " " + RedBiro.getNewQtyInStock()); System.out.println(SpiralNotebook.getPartCode() + " " + SpiralNotebook.getDescription() + " " + SpiralNotebook.getNewQtyInStock()); System.out.println(Shampoo.getPartCode() + " " + Shampoo.getDescription() + " " + Shampoo.getNewQtyInStock()); System.out.println(ShowerGel.getPartCode() + " " + ShowerGel.getDescription() + " " + ShowerGel.getNewQtyInStock()); } }
This is my class for my new stock list. However this is the output.
New Stock List
Part Code Description Quantity In Stock
324 Cheddar Cheese 0
396 Danish Blue Cheese 0
387 Black Olives 0
388 Green Olives 0
224 Blue Biros 0
225 Red Biros 0
267 Spiral Notebooks 0
123 Shampoo 0
145 Shower Gel 0
Any ideas?