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, 21.06.2019 22:00
Match the steps of the process to julia's analysis. 1. analyze choices. current costs for making phone calls to foreign countries averages between five and ten cents a minute. 2. determine the goals. julia needs to reduce the cost of telecommunications without reducing her employees' ability to do their jobs. 3. gather data. the corporate computer network will be able to handle the increased traffic that will occur as a result of voip. 4. evaluate the decision. julia will have her it department set up voip in the smallest domestic office. 5. make the decision. julia will have employees document the benefits and problems that result from using the new technology.
Answers: 1
question
Computers and Technology, 22.06.2019 12:10
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 24.06.2019 05:00
Who is most likely be your target audience if you create a slide presentation that had yellow background and purple text
Answers: 2
You know the right answer?
Copy the files Song. java , CompactDisc. java , and Classics. txt into NetBeans or other Java IDE to...
Questions
question
Advanced Placement (AP), 22.07.2019 12:30
question
Biology, 22.07.2019 12:30