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.
-
Describe the three basic competitive stances. Indicate the response to a price increase that each would predict. Then indicate the response to a price decrease that each would predict.
-
A regional telephone company operates three identical relay stations at different locations. During a one year period, the number of malfunctions reported by each station and the causes are shown...
-
A university pumps its water from wells located on campus. The falling water table has caused pumping costs to increase, the quantity of water available to decrease, and the quality of water to...
-
The Blending Department of Luongo Company has the following cost and production data for the month of April. Costs: Work in process, April 1 Direct materials: 100% complete ......$100,000 Conversion...
-
Centralized versus Decentralized Database Management Systems"Please respond to the following: Compare and contrast benefits and challenges that exist between centralized database management systems...
-
State the predicted height, taken from your graph, of the ping pong ball bounce when dropped from 4 m. Then draw a sketch of the ping pong ball at the top of its bounce (maximum height) and give your...
-
3.The average amount of beef yielded by a half-ton cow is 610 pounds. An amateur rancher thinks her cows are too fatty and yield less beef. She obtains a random sample of 30 of her cows and finds the...
-
What are the fundamental responsibilities of each of the following positions or departments: business reporting department, budgeting department, financial reporting officer, managerial reporting...
-
What primary functions does the AP/CD process perform? Explain each function.
-
What does the approved configuration plan specify?
-
What are the four stages through which a program should move as it is being developed? Who should have responsibility for each of those phases?
-
What are the approaches to obtaining an RFP?
-
Assuming a researcher is unable to find guidance in an IFRS standard or interpretation that is on point for a research question, what sources of guidance should the researcher consider next? Select...
-
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...
-
Because of the negative incentive effect that taxes have on goods with elastic supply, in the late 1980s Margaret Thatcher (then prime minister of Great Britain) changed the property tax to a poll...
-
Many of the buildings in Paris have Mansard roofs, such as those shown in the photograph on page 147. a. What property tax structure would bring this about? b. Could you imagine a change in the...
-
On September 29, 2008, the stock market fell almost 7%. How can we reconcile these kinds of huge losses in the stock market with the efficient market hypothesis?
Study smarter with the SolutionInn App