subject

Copy the files Song. java , CompactDisc. java , and Classics. txt into NetBeans or other Java IDE tools. Song. java is complete and will not be edited. Classics. txt is the data file that will be used by CompactDisc. java. We have learned about data file path in Project for chapter 4.Creating a new song with the title and artist and storing it in the appropriate position in the array. Print the contents of the array to the console. Compile, debug, and run. Your output should be as follows: Contents of Classics Ode to Joy by Bach The Sleeping Beauty by Tchaikovsky Lullaby by Brahms Canon by Bach Symphony No. 5 by Beethoven The Blue Danube Waltz by StraussThose are the instructions... Now here are the codes:Classic. txtOde to JoyBachThe Sleeping No. 5BeethovenThe Blue Danube WaltzStraussCompactDisc. java/**This program creates a list of songs for a CD by reading from a file*/import java. io.*;public class CompactDisc{ public static void main(String [] args) throws IOException { FileReader file = new FileReader("Classics. txt"); BufferedReader input = new BufferedReader(file); String title; String artist; //Declare an array of songs of size 6 Song [] cd = new Song [6]; for (int i = 0; i < cd. length; i++) { title = input. readLine(); artist = input. readLine(); // Task #2 step 2 - creating a new song with // the title and artist, and store it into the array, like // cd[i] = new Song(title, artist); } System. out. println("Contents of Classics:"); for (int i = 0; i < cd. length; i++) { // Task #2 step 3 - print the contents of the array to the console // using cd[i].toString() to get the contents string } }}Songs. java/*This program represents a song*/public class Song{ /**The title of the song*/ private String title; /**The artist who sings the song*/ private String artist; /**constructor @param title The title of the song @param artist The artist who sings the song */ public Song(String title, String artist) { this. title = title; this. artist = artist; } /**toString method returns a description of the song @return a String containing the name of the song and the artist */ public String toString() { return title + " by " + artist + "\n"; }}Ok.. So I am completely lost on this one... I can't get Netbeans to do anything with this at all.. First off, I don't understand how to read the Classics. txt file in

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
You know the right answer?
Copy the files Song. java , CompactDisc. java , and Classics. txt into NetBeans or other Java IDE to...
Questions
question
Mathematics, 03.02.2020 13:51
Questions on the website: 13722367