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 14:10
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_balance should be removed since header files should not contain constants.c)the definition of cashregister should be removed since header files should not contain class definitions.d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
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
Mathematics, 30.04.2021 01:00
question
English, 30.04.2021 01:00
question
Mathematics, 30.04.2021 01:00
question
Mathematics, 30.04.2021 01:00
question
Spanish, 30.04.2021 01:00
question
Mathematics, 30.04.2021 01:00
Questions on the website: 13722363