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:
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...
-
A steel rod is bent to form a mounting bracket. For each of the mounting brackets and loadings shown, determine the reactions at A and B. in -tie
-
According to Investopedia, the weekend effect is a phenomenon in financial markets in which stock returns on Mondays are often significantly lower than those of the immediately preceding Friday....
-
Why does average employee contribution offer a better estimate of the contribution of individuals to an organization than total compensation (wages, incentives, and benefits)?
-
The following selected transactions are from Springer Company. 2012 Nov. 1 Accepted a $ 4,800, 90-day, 8% note dated this day in granting Steve Julian a time extension on his past-due account...
-
Part A The vertical displacement of a wave traveling in the x-direction is given as: D(x, t) = (3.5 cm) sin(2.5x-132t), where x is in m and t is in s. Part B A Part C Part D Part E Part F What is the...
-
Micro Facilities incurs the following costs during the year. A new patent is purchased for $602,000 from Techno Company. The patent gives Micro exclusive right to sell specialized data storage units....
-
Classify each of the given electronic transitions for a hydrogen atom. Classify each of the given electronic transitions for a hydrogen atom. n=4 n=3 n=4 n=2 n=3 n=4 n=6 n=1 n=6n=2 n=2 n=5 n=1 n=5...
-
What is meant by tender of performance?
-
Tom took out a $2,000 loan to buy a boat at an interest rate of 10 percent a year. He plans to repay the loan after 2 years. How much will he have to pay?
-
Kathleen Liarkos purchased a used Jaguar XJS automobile from Pine Grove Auto Sales. After experiencing various mechanical problems, she discovered that the vehicles odometer had been turned back....
-
What has been the average growth rate of U.S. real GDP per person over the past 120 years? In which periods was growth most rapid and in which periods was it slowest?
-
What are the influences on the demand for U.S. dollars in the foreign exchange market?
-
Balance the chemical equation for the combustion of benzene, shown below. C6H6 + O2 CO + HO (a) (b) What is the matrix equation corresponding to the chemical equation? What is A-? (c) What is the...
-
Complete the following acid-base reactions: (a) HCCH + NaH
-
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...
-
The scientific name of a species (a) consists of two parts, the family name and the species name. (b) is always underlined. (c) is always in Latin. (d) includes only the species name.
-
What is a clade?
-
Life would be impossible without bacteria because (a) they photosynthesize. (b) they function in decomposition. (c) they reproduce quickly. (d) they occupy habitats where no other organisms can...
Study smarter with the SolutionInn App