Java playlist program. All the necessary information are on the pictures. The PlayList Project This assignment requires
Fantastic news! We've Found the answer you've been seeking!
Question:
Java playlist program. All the necessary information are on the pictures.
Transcribed Image Text:
The PlayList Project This assignment requires you to design a class that mimics the creation and use of a playlist for an mp3 player. The class will provide the capability to create a playlist by having the user enter playlist information from the keyboard, writing the playlist file (playlist.txt) to disk, reading the file from disk, and printing the read file on the screen. Your class needs to meet the following criteria and include the following methods: 1. All methods, including the main () method will be contained in a single class file. 2. The file name of the text file, for both writing and reading is to be "playlist.txt". 3. No constructors need to be used, methods can all be static. 4. The following methods: A method makeList (String array[]) which does the following: Prompts the user to enter the song title, artist name, and a rating (from 1 through 5) for each entry on the list. . ● ● Assigns the concatenated string to an array element. Each element represents a list item, and the array represents the playlist. • Calls printFile () to print each element of the array to the screen. A method writeFile (String array []) which does the following: Writes each element of the array to the playlist.txt file as a separate line in the file. Once the file has been written, calls print File () to print each element of the array to the screen.. . . A method readFile () which does the following: Calls a private helper method get NumLines () which reads the number of lines stored in the playlist.txt file (see below for more information). Reads each line of the playlist.txt file and assigns the line to an array element. Calls printFile() to print each element of the array to the screen. . . Concatenates the song title, artist name, and rating strings together separating each item by a comma (a comma delimited line of text). A method get NumLines () which does the following: Functions as a helper method to readFile(). Reads the number of lines in the playlist.txt file and returns that integer to the calling method or variable. . . . Uses a FileReader object wrapped by a BufferedReader object to facilitate the counting of lines. Returns an integer value to readFile () (or any other calling method or variable) representing the number of lines in the existing text file to be read. A printFile (String array[]) whose function is to print the playlist entries assigned to an array. The PlayList Project This assignment requires you to design a class that mimics the creation and use of a playlist for an mp3 player. The class will provide the capability to create a playlist by having the user enter playlist information from the keyboard, writing the playlist file (playlist.txt) to disk, reading the file from disk, and printing the read file on the screen. Your class needs to meet the following criteria and include the following methods: 1. All methods, including the main () method will be contained in a single class file. 2. The file name of the text file, for both writing and reading is to be "playlist.txt". 3. No constructors need to be used, methods can all be static. 4. The following methods: A method makeList (String array[]) which does the following: Prompts the user to enter the song title, artist name, and a rating (from 1 through 5) for each entry on the list. . ● ● Assigns the concatenated string to an array element. Each element represents a list item, and the array represents the playlist. • Calls printFile () to print each element of the array to the screen. A method writeFile (String array []) which does the following: Writes each element of the array to the playlist.txt file as a separate line in the file. Once the file has been written, calls print File () to print each element of the array to the screen.. . . A method readFile () which does the following: Calls a private helper method get NumLines () which reads the number of lines stored in the playlist.txt file (see below for more information). Reads each line of the playlist.txt file and assigns the line to an array element. Calls printFile() to print each element of the array to the screen. . . Concatenates the song title, artist name, and rating strings together separating each item by a comma (a comma delimited line of text). A method get NumLines () which does the following: Functions as a helper method to readFile(). Reads the number of lines in the playlist.txt file and returns that integer to the calling method or variable. . . . Uses a FileReader object wrapped by a BufferedReader object to facilitate the counting of lines. Returns an integer value to readFile () (or any other calling method or variable) representing the number of lines in the existing text file to be read. A printFile (String array[]) whose function is to print the playlist entries assigned to an array.
Expert Answer:
Answer rating: 100% (QA)
import javaio public class PlaylistManager public static void mainString args String playlist new String100 Max 100 songs for simplicity int choice do ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
What am I required to do in this assignment? Shared Power is an information system to help tradesmen share expensive and specialist tools rather than buying them themselves. Registered owners add...
-
For this assignment, you will need to copy the excel file provided in Project Assignment 1 into your UMSystem Office365 OneDrive. You should have been prompted to do so when you clicked on the link...
-
The total cost of 2 chair and 1 table is 210 dollars. The total cost of 1 chair and 2 tables is 285 dollars. What is the cost of 1 chair?
-
Visit the site at www.iasplus.com/country/useias.htm. a. Name three governments that require companies to prepare their financial reports only in accordance with IFRS in order to list their stocks on...
-
The Wall Street Journal has a daily listing of what are called "Money Rates or interest rates on short-term securities. Locate it either in a recent issue of the newspaper by looking at the index on...
-
University Health System has three divisions: Real Estate, with an 8 percent cost of capital; Health Services, with a 10 percent cost of capital; and Managed Care, with a 12 percent cost of capital....
-
Dye Company manufactures a single product. Annual production costs incurred in the manufacturing process are shown below for two levels of production. Instructions(a) Define the terms variable costs,...
-
When evaluating a project, the discount rate to be used should be the a. cost of preferred stock only. b. capital structure with which the project was financed. c. cost of equity only. d. average...
-
You are working on a free-form Packet Tracer challenge activity as seen in Figure 1, you have been given the London Railways network.' The purpose of this EMA question is to build upon each of the...
-
Brief Exercise 15-5 (Algo) Finance lease lessee income statement effects [LO15-2] A lease agreement that qualifies as a finance lease calls for annual lease payments of $10,000 over a five-year lease...
-
7. A point charge with a mass of 4.8x10-10 kg is moving with a constant velocity of 3.8x105 m/s to the left. It enters a region with an electric field of 6.1x107 N/C to the right, and after it...
-
Edward and Brenda are married and file a joint return. They have two children, ages 8 and 10, who lived with them for all of 2023. In 2023, Edwards income from his job was $33,000. Brenda was a...
-
A claim is a contested change where the buyer and the seller cannot reach an agreement on compensation for the change or cannot agree that a change has occurred. Explain
-
Link wants to make$100,000after tax on his newventureinto selling pizza-on-a-stick, using a "push along" cart at the beach. For each pizza-on-a-stick, he incurs raw material costs of$5 and sells them...
-
A factory has done an analysis of the maintenance department cost showing that there is a fixed element of Shs. 500,000 per month and a variable element related to machine hours amounting to Shs....
-
For this question, you should type which formula you should use (simple, compound, annuity, payout annuity, loan). You should also tell me which variable you will be solving for, and you should type...
-
A random sample of 10 houses heated with natural gas in a particular area, is selected, and the amount of gas (in therms) used during the month of January is determined for each house. The resulting...
-
Use any test to determine whether the series is absolutely convergent, conditionally convergent, or divergent. (-9)" n=1 n10"+1
-
The contour map shows the temperature, in degrees Fahrenheit, at 4:00 pm on February 26, 2007, in Colorado. (The state measures 388 mi west to east and 276 mi south to north.) Use the Midpoint Rule...
-
Verify that the function satisfies the three hypotheses of Rolles Theorem on the given interval. Then find all numbers c that satisfy the conclusion of Rolles Theorem. f(x) x 3 - 2x 2 - 4x + 2, [22,...
-
How many Hamilton cycles are in the graph? W Complete Graph R
-
Find the number of ways to arrange the letters \(v, w, x, y\), and \(z\).
-
Find the weight of the Hamilton cycle \(m ightarrow 0 ightarrow p ightarrow n ightarrow q ightarrow m\) in the given figure. 5 5, m 3 4 n 8 5' P 5 Weighted Complete Graph with Five Vertices
Study smarter with the SolutionInn App