Answer to Question #265636 in Computer Networks for nothando

Question #265636

Write a test program that creates some items of different types, adds them to the database, removes one of them and then prints out a list


1
Expert's answer
2021-11-13T23:53:59-0500

public class Main {

public static void main(String[] args) {

Database database = new Database();

database.addItem(new CD("Night","Good",25.2,"Tarja",20));

database.addItem(new CD("Twenty","Nice",20,"Tom",10));

database.addItem(new DVD("Ram","Excellent",300.5,"Till",18));

database.addItem(new DVD("Holly","Good",15.5,"Charlie",21));

database.printList();

database.removeItem("LOUNA");

System.out.println();

database.printList();

database.depreciateItems();

System.out.println();

database.printList();

}

}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS