Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write java doc for Jukebox.java. We don't have to make any changes in the program instead of change to Javadoc import java.util.ArrayList; import java.util.List; public
Write java doc for Jukebox.java. We don't have to make any changes in the program instead of change to Javadoc
import java.util.ArrayList; import java.util.List; public class Jukebox { Database db; int creditCard; public Jukebox(){ } public Jukebox(Database db, int creditCard) { super(); this.db = db; this.creditCard = creditCard; } public Database getDb() { return db; } public void setDb(Database db) { this.db = db; } public int getCreditCard() { return creditCard; } public void setCreditCard(int creditCard) { this.creditCard = creditCard; } public boolean isValidCreditCard(){ if(creditCard>0) return true; else return false; } void play(int i) { Song song=db.getSongList(i); song.play(); } void play() { for (int index=0;indextempSongList= new ArrayList (); tempSongList.add(song1); tempSongList.add(song2); tempSongList.add(song3); Database tempDB= new Database(tempSongList); Jukebox j= new Jukebox(tempDB, -123); //Validation of Credit Card System.out.println("Validity of CC : "+j.isValidCreditCard()); j.getDb().toString(); System.out.println(" Deleting Song @ index 2"); //Deleting Song @ index 2 j.getDb().removeSong(2); j.getDb().toString(); System.out.println("Playing the SongList"); j.play(); System.out.println("Playing Song @ index 2"); j.play(2); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started