Question
Specification The program will keep track of up to 3 albums, and up to 4 songs each album. When run, the program will display a
Specification The program will keep track of up to 3 albums, and up to 4 songs each album. When run, the program will display a menu of actions to the user, including one that exits the program. Until the user chooses to exit, the menu is displayed again after each action is completed. The program should have the following functionalities: 1. Will allow the user to create albums. 2. Will allow the user to enter a new song into an album. 3. Will prevent the user from adding a song in an album if exceeds a certain time limit (in song duration times). 4. Will allow the user to request a list of all songs (and the details of each song) from an album. 5. Will allow the user to request a list of all albums (including all the songs in each album). 6. Will allow the user to request a list of all songs whose duration is under a certain time (in minutes). 7. Will allow the user to request a list of all songs of a specific genre. 8. Will allow the user to delete an album. 9. Will allow the user to delete a song from an album. Your program must give appropriate messages to the user on an attempt to: • create an album that already exist (two albums are identical if they have the same name) • create another album when there is no room anymore. • add a song to an album that is full OR exceed a time limit OR in an album that does not exist. • add a song that already exist in an album (note that 2 songs are identical if name, artist, and duration are the same). • delete an album that does not exist. • delete song that does not exist. • Request list of albums/songs under a certain criteria (functionalities 4,5,6,and 7) and the number of albums/songs is zero.
Program Requirements Your program should implement three classes, which store the following data: • Song.java – storing the following details about a song. o name – the name of the song. o artist – the person/s performing the song. o duration – the length of the song in seconds o genre – the genre can be only “rock”, “pop”, “hip-hop” or “bossa nova” • Album.java – stores up to 4 Songs at a time. o name – the name of the Album. o song1, song2, song3, song4 – Song objects o totalTime – the total playing time of all songs stored o MAX_TIME – a constant which stores the maximum playing time for the album, set to a value of 12 (minutes). • SongCollection.java – stores all albums in the system. o album1, album2, album3 – All current Album objects stored in the system. All the data components of your classes need to be private (this means that you are applying the principles of encapsulation). Additionally, your classes need to have methods that provide the functionality outlined in the problem description. The only class which should have a main method is SongCollection.java, which should create an instance of the class SongCollection and call the run() method which will have code to provide the user with a menu to allow them to perform any of the tasks outlined in the problem description. The template for this is below. The class SongCollection also will be the only one that will receive inputs and show outputs.
public class SongCollection { private void run() { //This method should control the flow of the program //and have all code for accessing the Albums } public static void main(String[] args){ SongCollection sg = new SongCollection (); sg.run(); } } You cannot use arrays in this assignment. SENG1110 students can choose TIO or GUI, and should use only the classes seen in lectures. Your solution must be your own work. Marks will be awarded for: layout, both visual (variable names, indentation) and structural (scope of variables, use of methods); documentation (comments); and ability of the submission to perform as specified. A more detailed marking schema is available. What to submit. You should submit the Java program (Song.java, Album.java, SongCollection.java) and the assignment cover sheet electronically via the "Assignment 1" link on Blackboard. Do not include .class files in your submission. Add the name of the student(s) on the top of each Java file submitted. If you are completing the assignment as a group (only SENG1110 students), add both names in each Java file AND submit 2 assignment cover sheets.
Step by Step Solution
3.50 Rating (147 Votes )
There are 3 Steps involved in it
Step: 1
public class SongCollection private Album album1null album2null album3null private int end1 0 choice2 private String name1 private void run do Scanner console new ScannerSystemin Systemoutprintln1 cre...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