Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void addStock(Product[] products, Scanner sc) {
- int num=-1;
- System.out.println("How many values do you want to add: ");
- num = sc.nextInt();
- while(num < 0) {
- System.out.println("Please enter only positive values!");
- System.out.println("How many values do you want to add: ");
- num = sc.nextInt();
- }
- for(Product p: products) {
- p.addQuantity(num);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement