Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a NetBeans 8 project for this task, named Taski. You are required to write a Java 8 program that opens and reads a delimited

image text in transcribedimage text in transcribed

Create a NetBeans 8 project for this task, named Taski. You are required to write a Java 8 program that opens and reads a delimited data file that is located relative to the NetBeans project root folder. The delimited data file contains information about prize winning music albums ranked by sales. The data file is called albums.txt. The data file should not be altered and should be considered as a read-only data file. Within the 'albums' data file, there are 20 entries that each represent a single album. On the first line of each album entry there are six data fields representing the following information in order): the current sales ranking, the title of the album, the name of the artist, the year the album was released, and the total number of sales to date ('M' denotes million and 'K' denotes thousand). The first line is then followed by the list of song tracks for the album (one per line, in the original published order), with each track indicating the duration of the song (minutes:seconds) in braces. Each album entry is separated by a dashed line in the text file. You are required to implement a Java class to represent an album. The program should parse the data file, create an object for each album, and store all the objects into a suitable collection. Figure 3 provides a partial UML class representation of the class that you will need to implement. It indicates required data members and accessor (i.e., getter) methods that map to those data members, and a toString() method. It is left to you to determine class data types and how the Album objects should be initialised. Album title artist year sales tracks getTitle getArtist() getYear) getSales() getTracks() toString() Figure 3: UML class specification for Album class On starting the program, the following menu should be displayed to the console: List albums. Select album.. Search titles. Exit.. Enter choice:> The User can simply exit the program by entering zero. The three other menu options allow the User to inspect the information in the data set (note again that this program is entirely read-only and there is no requirement to add, update or delete any part of the data set). The necessary interaction of the program with respect to these options is illustrated in Appendix A. Note that console output should be neatly formatted, and some consideration will be given to formatting when the program is assessed. In particular, when the option to view a single trade company details is selected, it must result in the invocation of the toString() method for that particular Album object. You are encouraged to explore and utilise a String Builder object when implementing the toString() method for the Album class. Create a NetBeans 8 project for this task, named Taski. You are required to write a Java 8 program that opens and reads a delimited data file that is located relative to the NetBeans project root folder. The delimited data file contains information about prize winning music albums ranked by sales. The data file is called albums.txt. The data file should not be altered and should be considered as a read-only data file. Within the 'albums' data file, there are 20 entries that each represent a single album. On the first line of each album entry there are six data fields representing the following information in order): the current sales ranking, the title of the album, the name of the artist, the year the album was released, and the total number of sales to date ('M' denotes million and 'K' denotes thousand). The first line is then followed by the list of song tracks for the album (one per line, in the original published order), with each track indicating the duration of the song (minutes:seconds) in braces. Each album entry is separated by a dashed line in the text file. You are required to implement a Java class to represent an album. The program should parse the data file, create an object for each album, and store all the objects into a suitable collection. Figure 3 provides a partial UML class representation of the class that you will need to implement. It indicates required data members and accessor (i.e., getter) methods that map to those data members, and a toString() method. It is left to you to determine class data types and how the Album objects should be initialised. Album title artist year sales tracks getTitle getArtist() getYear) getSales() getTracks() toString() Figure 3: UML class specification for Album class On starting the program, the following menu should be displayed to the console: List albums. Select album.. Search titles. Exit.. Enter choice:> The User can simply exit the program by entering zero. The three other menu options allow the User to inspect the information in the data set (note again that this program is entirely read-only and there is no requirement to add, update or delete any part of the data set). The necessary interaction of the program with respect to these options is illustrated in Appendix A. Note that console output should be neatly formatted, and some consideration will be given to formatting when the program is assessed. In particular, when the option to view a single trade company details is selected, it must result in the invocation of the toString() method for that particular Album object. You are encouraged to explore and utilise a String Builder object when implementing the toString() method for the Album class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

1. Why did this situation come about?

Answered: 1 week ago