saol 4
saol 4
ArrayList;
import java.util.Scanner;
public InventoryManagementSystem() {
inventory.add(item);
if (item.getName().equals(name)) {
inventory.remove(item);
break;
}
while (true) {
switch (choice) {
case 1:
system.addItem();
break;
case 2:
system.removeItem();
break;
case 3:
system.displayInventory();
break;
default:
System.out.println("Invalid choice");
class Item {
this.name = name;
this.quantity = quantity;
return name;
return quantity;
}import java.util.ArrayList;
import java.util.Scanner;
public InventoryManagementSystem() {
inventory.add(item);
if (item.getName().equals(name)) {
inventory.remove(item);
break;
while (true) {
switch (choice) {
case 1:
system.addItem();
break;
case 2:
system.removeItem();
break;
case 3:
system.displayInventory();
break;
default:
System.out.println("Invalid choice");
}
}
class Item {
this.name = name;
this.quantity = quantity;
return name;
return quantity;