Design a class named Movie which stores the name of a movie (ex. Groundhog Day) and...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/6502a937efee3_1694673207319.jpg)
Transcribed Image Text:
Design a class named Movie which stores the name of a movie (ex. Groundhog Day) and its genre (ex. Comedy). Include the following methods: default constructor setting movie name and genre to empty string" parameterized constructor where the movie name and genre are passed via the parameter list accessor and mutator methods toString method to return a string representation of the data 2. Write a main application that reads a data file movies.txt and stores the data in an array of Movie. The array should start with capacity 50. Code can assume there are no more than 50 data sets in the file. Note an array must be used versus any high level collections (ex. ArrayList) that we have not yet studied. Processing: Display a menu of choices. Enter F to Find Movie Enter D to Display All Movies Enter G to Display Movies of a Genre Enter Q to Quit Use a sentinel-controlled loop to read choices until the user enters "Q". 1. If user enters "F", ask for the name of the movie. Display the movie name and genre or a message that the movie is not found. 2. If the user enters "D", display all movie names and genres in a formatted display. 3. If the user enters "G", ask for a genre. Display all movie names of this genre followed by a count of how many were found. Required Methods: Other methods can be added. Design a class named Movie which stores the name of a movie (ex. Groundhog Day) and its genre (ex. Comedy). Include the following methods: default constructor setting movie name and genre to empty string" parameterized constructor where the movie name and genre are passed via the parameter list accessor and mutator methods toString method to return a string representation of the data 2. Write a main application that reads a data file movies.txt and stores the data in an array of Movie. The array should start with capacity 50. Code can assume there are no more than 50 data sets in the file. Note an array must be used versus any high level collections (ex. ArrayList) that we have not yet studied. Processing: Display a menu of choices. Enter F to Find Movie Enter D to Display All Movies Enter G to Display Movies of a Genre Enter Q to Quit Use a sentinel-controlled loop to read choices until the user enters "Q". 1. If user enters "F", ask for the name of the movie. Display the movie name and genre or a message that the movie is not found. 2. If the user enters "D", display all movie names and genres in a formatted display. 3. If the user enters "G", ask for a genre. Display all movie names of this genre followed by a count of how many were found. Required Methods: Other methods can be added.
Expert Answer:
Answer rating: 100% (QA)
Lets start by creating the Movie class with the required methods public class Movie private String name private String genre Default constructor public Movie thisname thisgenre Parameterized construct... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
3) Lets revisit the 2-D shallow water equations, but this time assume no rotation (f= 0) but the wave is embedded in a mean zonal flow U: V= (U+u'(x, 1)) + v'(x, 1); (1) where variables in bold are...
-
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...
-
You will design and implement your own data class. The class will store data that has been read as user input from the keyboard (see Getting Input below), and provide necessary operations. As the...
-
Consider an increasing marginal-cost depletable resource with no effective substitute. (a) Describe, in general terms, how the marginal user cost for this resource in the earlier time periods would...
-
In your economics class, each homework problem set is graded on the basis of a maximum score of 100. You have completed 9 out of 10 of the problem sets for the term, and your current average grade is...
-
The 50-kg glass tabletop rests on the centrally located equilateral triangular frame which is supported by three legs. Determine the smallest vertical force P that, when applied to the glass, would...
-
Padro Company purchases a controlling interest in Salto Company. Salto had identifiable net assets with a cost of $400,000 and a fair value of $600,000. It was agreed that the total fair value of...
-
David Roberts began an upholstery cleaning business on August 1 and engaged in the following transactions during the month: Aug. 1 Began business by depositing $30,000 in a bank account in the name...
-
ABC company's common stoc ck is 10%. Dividends are expected to 2% in years 5 to infinity. Estimate the
-
Fokine Research Institute has three departments: biology, chemistry, and physics. The institute's controller wants to estimate the cost of operating each department. He has identified several...
-
Which of the following is not a goal of monetary policy? O Promote the increase of printed paper currency O Promote maximum stable employment O Prevent destruction of the currency's value O Prevent...
-
Dr. Kovaleski is interested in examining whether quantity of sleep impacts problem solving ability. To test problem solving ability, the research team gave participants a puzzle and measured how long...
-
Can you please help me fill out the spreadsheet? Idexo Corporation is a privately held designer and manufacturer of licensed college apparel in Cincinnati, Ohio. In late 2020, after several years of...
-
CHECK FIGURE: Adjusted book balance = $2,837.06 Mae Telford, the controller of the Baylor Company, provided the following information: Bank statement balance Add: Baylor Company Bank Reconciliation...
-
Read the Scenario Congratulations, you are now the Police Chief in Anytown, USA. A city with 30,000 residents and you are responsible to provide 24 hour a day police coverage. You have a total of 45...
-
Here are summary statistics for randomly selected weights of newborn girls: n = 36, x = 3180.6 g, s = 700.5 g. Use a confidence level of 99% to complete parts (a) through (d) below. a. Identify the...
-
XYZ's results for the year ended December 31, 2021, include the following material items: Sales revenue $ 6,200,000 Cost of goods sold 3,800,000 Selling and administrative expenses 1,300,000 Loss on...
-
What is the maximum volume of 0.25 M sodium hypochlorite solution (NaOCl, laundry bleach) that can be prepared by dilution of 1.00 L of 0.80 M NaOCl?
-
In Programming Exercise 9.7, the Account class was defined to model a bank account. An account has the properties account number, balance, annual interest rate, and date created, and methods to...
-
Listing 4.3, GuessBirthday.java, gives a program for guessing a birthday. Write a JSF program that displays five sets of numbers, as shown in Figure 33.30a. After the user checks the appropriate...
-
Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student...
-
1. The chapter discusses three classes of factors (people, structure, and technology) in determining what should be changed. With P&Gs eStore, how have each of these factors been affected?
-
One of the major challenges facing business in the twenty-first century is the rapid pace of changing technology. How would these challenges directly impact a company like Homestar runner?
-
3. How do the Chapman brothers measure job performance?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App