1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksju [112]
3 years ago
15

In this assignment, you will design and create an ArrayList-based application that manages a collection of DVDs. Information abo

ut a DVD includes title, category, running time, year, and price. The list of DVDs and the information for each DVD are stored in a text file before and after the program is executed.
Computers and Technology
1 answer:
sergij07 [2.7K]3 years ago
7 0

Create and design an arraylist based application which manages a DVDs collection.

Explanation:

DVD movie consists of a title, a rating (e.g. PG, R, etc.), and a running time in minutes.

In this project, you will create an application to allow the user to maintain a collection of DVD movies using an array.

When the application starts up, it will read in the DVD data from a text file to initialize the array, if the file is available. If the file is not there, then the program starts with an empty array. If the file is corrupted (has an invalid or missing value), then the program stops its initialization at the point of the error. The data file should contain one DVD per line, with title followed by rating followed by running time in minutes, all separated by commas. You may assume titles are all in uppercase and do not contain commas. For example:

ANGELS AND DEMONS,PG-13,138

STAR TREK,R,127

UP,PG,96

The titles may not be in alphabetical order, but the DVDs should be inserted into the array in alphabetical order.

The application will then allow its user to perform the following operations:

ADD OR MODIFY DVD - The user will be prompted to enter the title, rating and running time (in minutes) for a DVD. If the title is already in the array, then the rating and running time are updated to the supplied values. If the title is not in the array, a DVD is added to the array so that the array is sorted by title. Convert all titles to uppercase only.

REMOVE DVD - The user will be prompted to enter the title of a DVD. If the title is in the array, then the DVD is removed, shifting subsequent DVDs over one position to fill in the gap left by the removed DVD. Again, titles must match exactly (in uppercase).

GET DVDs BY RATING - The user will be prompted to enter a movie rating (e.g. PG). This operation displays a string containing all DVDs matching the given rating in the order that they appear in the DVD collection, separated by newline characters.

GET TOTAL RUNNING TIME - This operation displays the total running time of all DVDs in the collection for the user.

SAVE & EXIT - The user can quit the program, performing an automatic save if the DVD collection has been modified.

Java Files

DVD.java - A class to model a single DVD, including its title, rating and total running time.

DVDCollection.java - A class to model a collection of DVDs using an array.

DVDUserInterface.java - An interface that describes the operation required for any user interface to this DVD collection.

DVDGUI.java - A class that implements the DVDUserInterface interface and provides a graphical user interface to the DVD collection.

DVDConsoleUI.java - A class that implements the DVDUserInterface interface and provides a console user interface to the DVD collection.

DVDManager.java - A class that contains a main method that launches one of the two user interfaces for the user to work with the DVD collection based on the user input.

Complete the DVD class by completing the given methods (constructor, accessors and mutators). Add javadoc comments so you can generate a javadoc documentation file showing how to use this class.

The DVDCollection class uses an array to maintain the collection of DVDs. The DVDs should be stored in alphabetical order based on title starting at position 0 in the array, using adjacent cells. All titles should be stored in uppercase only and are assumed to be unique (no duplicates).

toString - returns a string containing all of the DVDs in the collection, separated by newlines characters, along with the value of numdvds and the length of the DVD array for debugging purposes. The string should be formatted as shown in the example below:

numdvds = 3

dvdArray.length = 7

dvdArray[0] = ANGELS AND DEMONS/PG-13/138min

dvdArray[1] = STAR TREK/R/127min

dvdArray[2] = UP/PG/96min

addOrModifyDVD - given the title, rating and running time of a DVD, add this DVD to the collection if the title is not present in the DVD collection or modify the DVD's rating and running time if the title is present in the collection.insert the DVD so that all DVDs are in alphabetical order by title.

removeDVD - given the title, this method should remove the DVD with this title from the collection if present. The title must match exactly (in uppercase). If no title matches, do not change the collection.

getDVDsByRating - given the rating, this method should return a string containing all DVDs that match the given rating in the order that they appear in the collection, separated by newlines.

getTotalRunningTime - this method should return the total running time of all DVDs in the collection. If there are no DVDs in the collection, return 0.

loadData - given a file name, this method should try to open this file and read the DVD data contained inside to create an initial alphabetized DVD collection.

save - save the DVDs currently in the array into the same file specified during the load operation, overwriting whatever data was originally there.

You might be interested in
Which of the following are correct? I. Hold the middle mouse button to rotate the model on the screen. II. To pan the model, hol
evablogger [386]

Answer:

II and III are correct

Explanation:

The software that the question is referring to here is the computer-aided design (CAD) software called Inventor by Autodesk.

I. Hold the middle mouse button to rotate the model on the screen. False

This will pan the model instead of rotating.

II. To pan the model, hold down the Ctrl key and the middle mouse button. True

Some versions need you to hold down the ctrl key and the middle mouse button to pan, while others is just the middle mouse button then you drag the mouse around. The middle mouse is the scroll wheel on most mice today. You basically, just hold down the scroll wheel as you move the mouse to pan the model.

III. Use the mouse scroll wheel to zoom in and out of the model. True

To zoom in or out, one will need to rotate the mouse scroll wheel forward to zoom in and backward to zoom out.

 

8 0
3 years ago
What is the Piston Displacement having 3-inch bore and 3-inch stroke?
n200080 [17]

Answer:

<h3>Displacement = 0.7854 x bore² x stroke x # of cylinders.</h3><h3 /><h3>.7854 x 3² x 3 x 4 = 84.82 cubic inches</h3>

Explanation:

<h2><em><u>PLEASE</u></em><em><u> </u></em><em><u>MARK</u></em><em><u> ME</u></em><em><u> BRAINLIEST</u></em><em><u> AND</u></em><em><u> FOLLOW</u></em><em><u> ME</u></em><em><u> LOTS</u></em><em><u> OF</u></em><em><u> LOVE</u></em><em><u> FROM</u></em><em><u> MY</u></em><em><u> HEART'AND</u></em><em><u> SOUL</u></em><em><u> DARLING</u></em><em><u> </u></em><em><u>TEJASWINI</u></em><em><u> SINHA</u></em><em><u> HERE</u></em><em><u> </u></em><em><u>❤️</u></em></h2>
3 0
3 years ago
Which programming languages is best for game development? ​
kvasek [131]

Answer:

JavaScript. .

HTML 5.

SQL.

Python. .

Explanation:

hold it helps◕‿◕

3 0
2 years ago
What is the answer ??​
Natali5045456 [20]

<em>=</em><em> </em><em>Option</em><em> </em><em>b</em><em> </em><em>Minicomputer ..........</em>

3 0
2 years ago
Read 2 more answers
Hydraulic pressure is the same throughout the inside of a set of brake lines. What determines the amount of resulting mechanical
cestrela7 [59]

Answer: 1000 square ponds of force hope you know the answer

Explanation: i guessed

7 0
2 years ago
Other questions:
  • What term refers to a piece of software that interfaces with the hardware on your computer?
    10·2 answers
  • When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
    6·1 answer
  • _ includes websites that encourage interaction and connection among people, businesses, and organizations.
    5·1 answer
  • What is the role of programmers in an organization?
    6·1 answer
  • Is spread spectrum transmission done for security reasons in commercial WLANs?
    13·1 answer
  • Effective scrum masters apply which coaching behavior
    5·1 answer
  • Which are benefits of group discussions? Check all that apply. Learning becomes more interesting. Students engage in learning. L
    12·2 answers
  • 19. Fatigue can help improve your reaction time.<br> False<br> O True
    8·2 answers
  • A user calls the help desk reporting that a laptop with Linux freezes on startup and displays kernel panic. What could cause thi
    12·1 answer
  • Edit the program provided so that it receives a series of numbers from the user and allows the user to press the enter key to in
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!