InventoryProgramPart3

InventoryProgramPart3 - To change this template choose...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inventory.program.part.pkg3; /** * * @author janaya */ public class InventoryProgramPart3 { private static Inventory i; /** * @param args the command line arguments */ public static void main(String[] args) { // create 3 products ExtendedDVD p1 = new ExtendedDVD(1, "Tyler Perry's I Can Do Bad All By Myself", 3, 14.99, "24 hours"); ExtendedDVD p2 = new ExtendedDVD(2, "Shottas", 5, 19.99, "22 hours"); ExtendedDVD p3 = new ExtendedDVD(3, "Wanted", 4, 18.99, "18 hours"); // make inventory i = new Inventory(3); i.add(p1, 0); i.add(p2, 1); i.add(p3, 2); // sort i.sort(); // output for (int k = 0; k < 3; k++) { System.out.println(i.get(k)); } System.out.println(); // total val System.out.printf("Total value = $%.2f", i.totalValue()); } } class DVD { int dvdNumber; String dvdName; int quantity; double price; /* *Public constructor InventoryProgram1 *This constructor takes the dvdNumber as string, the dvdName as string, a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

InventoryProgramPart3 - To change this template choose...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online