1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
-
- /**
- * Write a description of class Inventory here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- import java.util.Scanner;
- //
- public class Inventory extends ProductItem {
-
- //Show item
- public void printitem()
- {
- super.outputid();
- super.outputquantity();
- super.outputpr();
- }
-
- //create item
- public ProductItem itemcreation()
- {
- ProductItem newitem = new ProductItem();
- Scanner keyboard = new Scanner (System.in);
- int newid;
- System.out.println("Enter new value for ID: ");
- super.setid(newid= keyboard.nextInt());
- int newquantity;
- System.out.println("Enter new value for Quantity: ");
- super.setquantity(newquantity= keyboard.nextInt());
- int newprice;
- System.out.println("Enter new value for Price: ");
- super.setpr(newprice= keyboard.nextInt());
- return newitem;
- }
- // public int getTotalQuantity(){
- // //go through each product
- // for (Productitem P : productitem){
- // //get quantity from product
- // //add them all up
- // total +=p.getQuantity();
- // }
-
-
-
-
- // return total;
-
- }
-
-
- //edit item
-
|