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
How many total bits are required for a direct-mapped cache with 128 blocks and a block size of 8 bytes, assuming a 4GB main memo
Marysya12 [62]

Answer:

32

Explanation:

Total bits will be 32 only as address is of 32 bits

(meaning to ask the size of the cache)

7 0
2 years ago
In a database, __________ is used to uniquely identify each record for retrieval or manipulation. answer an attribute or a field
spayn [35]
Hello <span>August1859 
</span>
Answer: In a database, a key field is used to uniquely identify each record for retrieval or manipulation.

Hope This Helps!
-Chris
8 0
3 years ago
Match each term in the second column with its correct definition in the first column. Write the letter of the term on the blank
Thepotemich [5.8K]

Answer:

1. Pie chart.

2. Goal seek.

3. Relative reference cell.

4. Data marker.

5. Chart sheet.

6. What-If-Analysis.

7. Rate = \frac {Amount \; of \; increase}{Base}

8. Order of operations.

9. Formula AutoComplete.

10. Axis.

11. Category axis.

12. Value axis

13. Value \; after \; increase = Base * Percent \; for \; new \; value

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

Some of the terminologies and features of the Microsoft Excel software includes the following;

1. Pie chart: a chart that shows the relationship of each part to a whole.

2. Goal seek: a what-if-analysis tool that finds the input needed in one cell to arrive at the desired result in another cell.

3. Relative reference cell: in a formula, the address of a cell based on the relative position of the cell that contains the formula and the cell referred to in the formula.

4. Data marker: a column, bar, area, dot, pie slice, or other symbol in a chart that represents a single data point.

5. Chart sheet: a workbook sheet that contains only a chart.

6. What-If-Analysis: the process of changing the values in cells to see how those changes affect the outcome of formulas in a worksheet.

7. Rate = \frac {Amount \; of \; increase}{Base}: The mathematical formula to calculate a rate of increase.

8. Order of operations: the mathematical rules for performing multiple calculations within a formula.

9. Formula AutoComplete: the excel feature which, after typing - and the first letter of a function, displays a list of function names.

10. Axis: a line that serves as a frame of reference for measurement and that borders the chart plot area.

11. Category axis: the area along the bottom of a chart the identifies the categories of data, also referred to as the x-axis.

12. Value axis: a numerical scale on the left side of a chart that shows the range of numbers for the data points, also referred to as the y-axis.

13. Value \; after \; increase = Base * Percent \; for \; new \; value: the formula for calculating the value after an increase by multiplying the original value the base by the percent for new value.

5 0
3 years ago
What type of platform is SAP?
Alex787 [66]
SAP is a data and business processing platform.
7 0
3 years ago
Which of the following is true for an API? I. Allows different devices to connect with each other II. Allows for Interactivity b
Zina [86]

Answer:

All of the above.

Explanation:

API is an acronym for application programming interface and it can be defined as a software intermediary (computing interface) comprising of sets of codes, tools and protocols that helps software applications and the computer to communicate with each other, as well enable the exchange of data. Some examples of popular APIs are Go-ogle, Face-book, Twitter etc.

The main characteristics and functions of an application programming interface (API) includes;

I. Allows different devices to connect with each other.

II. Allows for Interactivity between devices and software.

III. Messenger program that takes requests and delivers the response back to the user.

IV. Allows the creation of applications that access the features or data of an operating system, application, or other services.

V. Specifies how software components should interact.

VI. Used when programming graphical user interface (GUI) components

6 0
3 years ago
Other questions:
  • For some brand-name computers, the hard drive contains a partition that can be used to reinstall windows. what is the name for t
    6·1 answer
  • A retail company assigns a $5000 store bonus if monthly sales are $100,000 or more. Additionally, if their sales exceed 125% or
    5·1 answer
  • In what ways are Outlook notes useful for personal or professional use? Check all that apply.
    13·2 answers
  • Learning about public speaking can help improve your ________________.
    15·1 answer
  • Henry, a graphic artist, wants to create posters. Which software should Henry use for this purpose?
    13·1 answer
  • The Windows Remote Desktop Web connection that allows users to connect to a work or home computer and access files is considered
    7·2 answers
  • Which of the following allows the transmission of voice and often video communication over the internet?
    12·1 answer
  • You are implementing a new application control solution. Prior to enforcing your application whitelist, you want to monitor user
    5·1 answer
  • Five uses of the operating system​
    10·2 answers
  • Drag each tile to the correct box.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!