In a movie library application, you are asked to consider the following kinds of movies: >...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In a movie library application, you are asked to consider the following kinds of movies: > Movie, a class describing all kinds of movies. > Action, a movie containing lots of explosions. Romance, a movie where romantic interest drives the plot. > Comedy, a movie with largely humorous content. > Mystery, a who done it movie. > Rescue, a hybrid action-romance movie, where the main character attempts to save his or her romantic interest from almost certain doom. > Romantic Comedy, a hybrid romance-comedy with large amounts of both humorous and romantic content. > Hollywood Blockbuster, an action-romance-comedy-mystery movie designed to please crowds. • What interfaces and classes would you use to represent the previous list of movies? Write your answer by carefully drawing a UML dass/interface hierarchy, identifying which nodes are classes and which are interfaces. o Note that there must be a class for each type of the movies, but you may use any interfaces you require to preserve the relationships between types. Adequately, implement all the classes/interfaces. Include whatever methods/parameters necessary in each class/interface. Your classes should all implement the Cloneable and Comparable interfaces. Force all the sub-classes to override toString method. Create a text file "movies.txt" that includes information about variety of movies. The following is a sample movies.txt file: Type: Title, [Starring], Running time, Country, Language. Comedy: Minions, [Sandra Bullock, Jon Hamm], 91, USA, English. Action: The Matrix, [Keanu Reeves, Laurence Fishburne], 120, USA, English. Hollywood Blockbuster: Gladiator, [Russell Crowe, Joaquin Phoenix], 155, USA, English. Mystery: Harry Potter, [Daniel Radcliffe, Rupert Grint, Emma Watson], 178, UK, English. Action: Entrapment, [Sean Connery, Catherine Zeta-Jones], 113, USA, English. Comedy: Dumb and Dumber, [Jim Carrey, Jeff Daniels], 107, USA, English. Rescue: Avatar, [Sam Worthington, Zoe Saldana), 161, USA, English. Romance: Titanic, [Leonardo DiCaprio, Kate Winslet, Bily Zane], 195, USA, English. Write a test program that do the following: o Open and read the movies.txt file that you created in the previous step. o Convert each line to the appropriate movie class based on the first token (e.g. Comedy). o Create an ArrayList of movies to store the created movies from the previous step. o Write a method to sort the ArrayList of movies based on movie type and running time. • Write the sorted ArrayList of movies into a file called "sorted_movies.txt". In a movie library application, you are asked to consider the following kinds of movies: > Movie, a class describing all kinds of movies. > Action, a movie containing lots of explosions. Romance, a movie where romantic interest drives the plot. > Comedy, a movie with largely humorous content. > Mystery, a who done it movie. > Rescue, a hybrid action-romance movie, where the main character attempts to save his or her romantic interest from almost certain doom. > Romantic Comedy, a hybrid romance-comedy with large amounts of both humorous and romantic content. > Hollywood Blockbuster, an action-romance-comedy-mystery movie designed to please crowds. • What interfaces and classes would you use to represent the previous list of movies? Write your answer by carefully drawing a UML dass/interface hierarchy, identifying which nodes are classes and which are interfaces. o Note that there must be a class for each type of the movies, but you may use any interfaces you require to preserve the relationships between types. Adequately, implement all the classes/interfaces. Include whatever methods/parameters necessary in each class/interface. Your classes should all implement the Cloneable and Comparable interfaces. Force all the sub-classes to override toString method. Create a text file "movies.txt" that includes information about variety of movies. The following is a sample movies.txt file: Type: Title, [Starring], Running time, Country, Language. Comedy: Minions, [Sandra Bullock, Jon Hamm], 91, USA, English. Action: The Matrix, [Keanu Reeves, Laurence Fishburne], 120, USA, English. Hollywood Blockbuster: Gladiator, [Russell Crowe, Joaquin Phoenix], 155, USA, English. Mystery: Harry Potter, [Daniel Radcliffe, Rupert Grint, Emma Watson], 178, UK, English. Action: Entrapment, [Sean Connery, Catherine Zeta-Jones], 113, USA, English. Comedy: Dumb and Dumber, [Jim Carrey, Jeff Daniels], 107, USA, English. Rescue: Avatar, [Sam Worthington, Zoe Saldana), 161, USA, English. Romance: Titanic, [Leonardo DiCaprio, Kate Winslet, Bily Zane], 195, USA, English. Write a test program that do the following: o Open and read the movies.txt file that you created in the previous step. o Convert each line to the appropriate movie class based on the first token (e.g. Comedy). o Create an ArrayList of movies to store the created movies from the previous step. o Write a method to sort the ArrayList of movies based on movie type and running time. • Write the sorted ArrayList of movies into a file called "sorted_movies.txt".
Expert Answer:
Answer rating: 100% (QA)
Driverjava import javaioBufferedReader import javaioFileReader public class Driver public static voi... View the full answer
Related Book For
Elementary Statistics Picturing the World
ISBN: 978-0321911216
6th edition
Authors: Ron Larson, Betsy Farber
Posted Date:
Students also viewed these accounting questions
-
You have been asked to consider the following specific questions in preparing a report to Nationwide Horizons board of directors. Q. 1. Was there a reasonable economic basis for the termination of...
-
In this simulation, you are asked to address questions related to the accounting for taxes.Prepare responses to allparts. KWW Professional Simulation Time Remaining 2 hours 40 minutes Accounting for...
-
In this simulation, you are asked to address questions related to the accounting for leases. Prepare responses to all parts. (Round amounts to the nearestcent.) KWW Professional Simulation Time...
-
Advertising plays a major role in the ______________ stage of the product life cycle, and_______________ plays a major role in the maturity stage.
-
Gomi Medical Labs, Inc. began operations five years ago producing a new type of instrument it hoped to sell to doctors, dentists, and hospitals. The demand for the new instrument was much higher than...
-
Engineers are designing a large elevator that will accommodate 40 people. The maximum weight the elevator can hold safely is 8120 pounds. According to the National Health Statistics Reports, the...
-
The accounting records of Compass Bookstores, Inc., include the following: Requirement Report these liabilities on Compass Bookstores' balance sheet, including headings and totals for current...
-
New Millennium Company earned $2.5 million in net income last year. It took depreciation deductions of $300,000 and made new investments in working capital and fixed assets of $100,000 and $350,000,...
-
Tommy arranged a P10,000,000 revolving credit agreement with a group of banks. The company paid an annual commitment fee of 0.5% of the unused balance of the loan commitment. On the used portion of...
-
Jane Company purchased merchandise . The following information is available: Terms: 15/10 n /60 Original purchase amount: $ 7,000 Return amount: $ 1,000 (2 days after purchase ) Payment of cash: Paid...
-
Which factor under Bargaining Power of Buyers does this represent? Read the case study Air Express Industry: 40 Years of Expansion and answer the above question
-
Steveston has predicted a sales increase of 15%. It has predicted that every item on the statement of financial position will increase by 15% as well. What is the plug variable?
-
A new punching machine will cost $3,668. At the end of its 10 years useful life, the machine can be sold for $830. The new machine will reduce annual expenses by $619. The interest rate is 10%. What...
-
How would you categorize the risk that slow vaccine roll-out has posed to global trade? (Commercial risk? Country risk? Currency risk? Other risk? etc.) Why?
-
Importers can face a number of kinds of risk when doing international business. Which ONE (1) kind of risk is the hardest to deal with? Why?
-
If you were a US senator, what policy would you propose for debate in the Congress to address the public's concern of wasteful federal spending? Do you see any resistance to the policy?
-
Read the following statistical report: Voluntary tests of 25,000 drivers throughout the United States showed that 25 percent of them use some drug while driving and that 85 percent use no drugs at...
-
4. Jobe dy -Y 2 et by
-
In Exercises 32, do the following. (a) Find the equation of the regression line for the data, letting Row 1 represent the x-values and Row 2 the y-values. Sketch a scatter plot of the data and draw...
-
In Exercises 16 write the binomial probability and the normal probability for the shaded region of the graph. Find the value of each probability and compare the results. P(x) 0.24 0.20 0.16 0.12 0.08...
-
Use a continuity correction to convert each binomial probability to a normal distribution probability. 1. The probability of getting between 57 and 83 successes, inclusive 2. The probability of...
-
If the 3-in.-diameter short rod is made from brittle material having an ultimate strength of \(\sigma_{\text {ult }}=60 \mathrm{ksi}\), for both tension and compression, determine if the shaft fails...
-
If the 3-in.-diameter shaft is made from cast iron having tensile and compressive ultimate strengths of \(\left(\sigma_{\mathrm{ult}} ight)_{t}=40 \mathrm{ksi}\), and \(\left(\sigma_{\mathrm{ult}}...
-
The shaft consists of a solid segment \(A B\) and a hollow segment \(B C\), which are rigidly joined by the coupling at \(B\). If the shaft is made from A-36 steel, determine the maximum torque \(T\)...
Study smarter with the SolutionInn App