Welcome to DrJava. Working directory is E:\github\tietokonetyo\code > run VarastoTesti setNimi("Sivuvarasto") :true setLahiosoite("Tammikuja 5") :true setPostinumero("20360") :true setKaupunki("Turku") :true Luotu uusi varasto: Sivuvarasto: Tammikuja 5, 20360, Turku, 0 Uusi tuote: 1 Puhelin A55 150.0 5 5 750.0 Uusi tuote: 2 Tietokone B5 920.5 12 15 11046.0 Uusi tuote: 3 Monitori B8 120.95 31 30 3749.4500000000003 Tuotteita: tulostin, kamera, kaiuttimet Lisätään tuotteet varastoon: addTuote(puhelin) true addTuote(puhelin) false addTuote(monitori) true addTuote(tietokone) true addTuote(monitori) false Luodaan useilla viallisilla arvoilla tuote ja lopuksi hyväksytyillä arvoilla: java.lang.IllegalArgumentException: Laiton hinta: -10.95 java.lang.IllegalArgumentException: Laiton määrä: -31 java.lang.IllegalArgumentException: Laiton hälytysraja: -10 addTuote(viallinen) true tuotetesti() 8 0,00 0 -1 0,00 tuote.setNimi("Puhelin"): true tuote.setNimi(""): true tuote.setHinta(150): true tuote.setHinta(-150): false tuote.setHinta(0): true tuote.setHyllypaikka("A55"): true tuote.setHyllypaikka(""): true tuote.setMaara(-5): false tuote.setMaara(0): true tuote.setHalytysraja(-5): false tuote.setHalytysraja(0): true tuote.setHalytysraja(-1): true tuote.setId(-5): false tuote.setId(0): false tuote.setId(100): true 100 0,00 0 -1 0,00 tuote.setMaara(6): true tuote.setHalytysraja(5): true tuote.isVarastoHalytys(): false tuote.setMaara(5): true tuote.isVarastoHalytys(): true tuote.takeMaara(4): true tuote.isVarastossa(): true 100 0,00 1 5 0,00 tuote.setMaara(0): true tuote.isVarastossa(): false tuote.addMaara(10): true tuote.setHinta(10.50): true tuote.getKappaleidenArvo(): 105.0 Tuotetiedot: ============ id: 100 nimi hyllypaikka: hinta: 10,50 määrä: 10 hälytysraja: 5 arvo: 105,00 Tuotetiedot: ============ id: 1000 nimi hyllypaikka: hinta: 0,00 määrä: 0 hälytysraja: -1 arvo: 0,00 Tuotetiedot: ============ id: 1001 nimi hyllypaikka: hinta: 0,00 määrä: 0 hälytysraja: -1 arvo: 0,00 Tulosta varaston tiedot (printVarasto(): Varasto ======= nimi: Sivuvarasto lähiosoite: Tammikuja 5 postinumero: 20360 kaupunki: Turku tuottenimikkeitä: 7 getNimi(): Sivuvarasto getLahiosoite(): Tammikuja 5 getPostinumero(): 20360 getKaupunki(): Turku Kallein tuote: 2 Tietokone B5 920.5 12 15 11046.0 Eniten varastossa: 5 Kamera B10 125.0 50 5 6250.0 Varaston arvo: 22954.3 Otetaan tuotteesta (monitori.takeMaara(2)): true Varaston arvo: 22954.3 Hae tuote (getTuote(Monitorivmlkfmsdfkml): [] Löytyi: 0 kappaletta. setTuotteenHinta(2,1050.50): true setTuotteenHinta(0,1050.50): false setTuotteenHinta(2,-30): false setTuotteenMaara(2,14): true setTuotteenMaara(0,14): false setTuotteenMaara(2,-50): false Kaikki varaston tuotteet ========================= id nimi hylly hinta kpl häl. yhteensä 4 Tulostin B9 70,00 10 5 700,00 5 Kamera B10 125,00 50 5 6250,00 6 Kaiuttimet B11 19,90 6 10 119,40 1 Puhelin A55 150,00 5 5 750,00 3 Monitori B8 120,95 31 30 3749,45 2 Tietokone B5 920,50 12 15 11046,00 7 10,95 31 10 339,45 Tuotteet jotka on hälytysrajan alla =================================== id nimi hylly hinta kpl häl. yhteensä 6 Kaiuttimet B11 19,90 6 10 119,40 1 Puhelin A55 150,00 5 5 750,00 2 Tietokone B5 920,50 12 15 11046,00 Tuotteet joiden maksimimäärä on 7 ====================================== id nimi hylly hinta kpl häl. yhteensä 6 Kaiuttimet B11 19,90 6 10 119,40 1 Puhelin A55 150,00 5 5 750,00 Haetaan ja poistetaan tuote. (popTuote(1)) Tuotteen poisto ei onnistunut! 1 Puhelin A55 150.0 5 5 750.0 Haetaan ja poistetaan tuote. (popTuote(500)) null Onko tuote: isTuote(7): true Haettu tuote: 7 10.95 31 10 339.45 Poistettu tuote (deleteTuote(tuote): false Hae tuote (getTuote(Monitori): [3 Monitori B8 120.95 31 30 3749.4500000000003] 3 HYÖKKÄYS!! B8 120.95 31 30 3749.4500000000003 Kaikki varaston tuotteet ========================= id nimi hylly hinta kpl häl. yhteensä 4 Tulostin B9 70,00 10 5 700,00 5 Kamera B10 125,00 50 5 6250,00 6 Kaiuttimet B11 19,90 6 10 119,40 1 Puhelin A55 150,00 5 5 750,00 3 Monitori B8 120,95 31 30 3749,45 2 Tietokone B5 920,50 12 15 11046,00 7 10,95 31 10 339,45 >