Question: Please complete in java Production class The Production class describes information of a production company. It has following attributes: Attribute name Attribute type Description companyName

Please complete in java

Production class

The Production class describes information of a production company. It has following attributes:

Attribute name

Attribute type

Description

companyName

String

The name of the production

locationCity

String

The city of the location of the production company

locationState

String

The state of the location of the production company

The following constructor should be provided to initialize each attribute. This constructor initializes the value of string attributes to "?". public Production( )

The following accessor methods should be provided to get the attributes: public String getCompanyName() public String getLocationCity() public String getLocationState()

The following modifier(mutator) methods should be provided to set the attributes: public void setCompanyName(String someName) public void setLocationCity(String someCity) public void setLocationState(String someState)

The following method must be defined:

public String toString()

toString method should return a string of the following format: MGM at Hollywood,CA where "MGM" is a company name, "Hollywood" is its city name, and "CA" is its state. So you need to insert "," or a string between these variables. Note that you can choose a meaningful parameter variable name for each method.

Movie class

The Movie class describes a movie. It has the following attributes:

Attribute name

Attribute type

Description

movieTitle

String

The title of the Movie.

year

int

The year of the movie

length

int

The length of the movie

prodCompany

Production

The production company of the movie

The following constructor should be provided to initialize each attribute. This constructor initializes the value of string attributes to "?" and the value of integer attribute to 0, and an object of Production using the constructor of the Production class. public Movie( )

The following accessor methods should be provided to get the attributes: public String getMovieTitle() public int getYear() public int getLength() public Production getProdCompany()

The following modifier(mutator) methods should be provided to change the attributes: public void setMovieTitle(String someTitle) public void setYear(int someYear) public void setLength(int someLength) public void setProdCompany(String someName, String someCity, String someState)

The following method must be defined:

public String toString()

The toString() method constructs a string of the following format:

Movie Title:\t\tToy Story Movie Length:\t\t81 Movie Year:\t\t1995 Movie Production:\tPixar Animation at Emeryville,CA

Assignment4

(Note that this part is already done in the Assignment4.java file that is given to you. This explains each functionality of this class.)

In this assignment, download Assignment4.java file by clicking the link, and use it for your assignment. You do not need to modify Assignment4.java file. You only need to write Movie.java and Production.java files.

The following is the description of Assignment4 class.

The driver program will allow the user to interact with your other class modules. The purpose of this module is to handle all user input and screen output. The main method should start by displaying the following menu in this exact format:

Choice\t\tAction ------\t\t------ A\t\tAdd Movie D\t\tDisplay Movie Q\t\tQuit ?\t\tDisplay Help

Next, the following prompt should be displayed:

What action would you like to perform?

Read in the user input and execute the appropriate command. After the execution of each command, re-display the prompt. Commands should be accepted in both lowercase and uppercase.

Add Movie

Your program should display the following prompt:

Please enter the Movie information:: Enter its title:

Read in the user input and set the title on the movie object. Then it will ask a user to enter a movie length, its movie year, its production company's name, city, and state.

Read in the user input and set them on the movie object.

Note that there is only one Movie object in this assignment. Thus when "Add Movie" option is selected more than once, the new one overwrites the old Movie object information.

Display Movie

Your program should display the movie information in the following format:

Movie Title:\t\tToy Story Movie Length:\t\t81 Movie Year:\t\t1995 Movie Production:\tPixar Animation at Emeryville,CA

Make use of the toString method of the Movie class to display this information. The toString method is used together with System.out.print method. (System.out is NOT to be used within the toString method.)

Quit

Your program should stop executing and output nothing.

Display Help

Your program should redisplay the "choice action" menu.

Invalid Command

If an invalid command is entered, display the following line:

Unknown action

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!