Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static 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(int i=0; i<index; i++) {
- products[i].addQuantity(num);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement