Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help (Java Programming Only) :- There are two main parts to this assignment. 1) Write the Movie class. 2) Write two classes to handle

Please Help (Java Programming Only) :- There are two main parts to this assignment. 1) Write the Movie class. 2) Write two classes to handle the user interface.

Part 1 - Class Specifications

Class Movie:- Store in project/package: .bcs345.hwk.movies.business

Member Variables (all private)

Variable

Data Type

Description
Title String

Contains the title of the movie.

OpenDate MyDate

Contains the release date of the movie.

Budget double

Contains the budget for the movie in millions. For example, if the budget for the movie were 100,000,000 then the number 100 should be used.

BoxOfficeRevenue BoxOffice

Contains box office data for the movie.

Member Method Signatures and Descirptions (all public)

Signature Description

Default Constructor

Default constructor. Sets the values of each member variable to default values.

Hint: Make sure that new is called for reference types.

Get/set methods for all member variables

double CalculateNet()

Returns the net for the movie. The net is the amount of money the movie made. This is the movie gross minus the budget.

Note: This method should NOT print anything on the screen. It just returns the data from the function.

void Write(PrintStream ps)

Write the contents of all member variables to the given instance of PrintStream. Assume the PrintStream is already open and ready to use. Data should be written on to separate lines. DO NOT ADD ANY DESCRIPTIVE TEXT IN THE OUTPUT. JUST PRINT THE VALUES.

IMPORTANT - Whatever data is written out should be readable by the Read method of this class. If descriptive text is added then Read will not work.

void Read(Scanner s)

Read the contents of all member variables from the given instance of Scanner. Assume the following:

Scanner is already open.

Member variable values are on separate lines.

String GetJSON()

This method should return a string using JSON formatting (www.json.org). Here is the format:

{ variable name : value, }

Each variable name should be surrounded by quotes. If the variable data type is String then the value should be surrounded by double quotes. There should be a comma between each pair (no comma after the last pair).

Check at the end of document for an example of a properly formatted JSON string for this class.

String toString()

This method should show descriptive text and data. It will be used to display a date to the user.

For example:

Title: Wonder Woman

Open Date: 5/25/2017

Budget: 150.0

Gross: 797.1

Theater Count: 4165

Class MoviesConsoleUI

Store in project/package: .bcs345.hwk.movies.presentation

Member Variables (all private)

Data Type

No member variables

Member Method Signatures and Descriptions (all public)

Signature Description

void ShowUI()

Shows the user interface and handles user choices. When this method is called it should do the following:

Display the menu to the user.

Process the user selections.

There should be no display or processing code in main. See the Menu Description section below for details.

Class Main

Store in project/package: .bcs345.hwk.movies.presentation

Member Variables (all private)

Data Type

No member variables

Member Method Signatures and Descriptions (all public)

Signature

public static void main(String args[])

Just create an instance of MoviesConsoleUI inside of main and call the ShowUI method on it. No other code should be in main.

Comment out any code that was previously in main.

Movies UI Menu Description

This program will present a menu to the user and then perform an action depending on what the user chooses to do. You should create an instance of Movie inside of ShowUI. When the program runs it should display the menu to the user and give them a chance to input a choice. An action should be taken depending on what choice the user makes.

Here is the user menu:

Daily Attraction Usage UI

-------------------------

1 Read movie from file

2 Write movie to file

3 Show movie data with descriptive text on screen

4 Show movie JSON on screen

5 - Exit

Enter Choice:

THE PROGRAM SHOULD KEEP SHOWING THE MENU AND PERFORMING AN ACTION UNTIL THE USER CHOOSES TO EXIT.

Choice Action
1

Reads in one movies data into a Movie instance from a user-specified file. This menu option expects data to come in according to the Movie file format specified at the end of the assignment. The user should be prompted to enter a filename to read from.

Hint: You can use a function on Movie to help out with this.

2

Writes data from the Movie instance to a file. The user should be prompted to enter a filename to write the data to. Data should be written out according to the Movie file format specified at the end of this assignment.

Hint: You can use a method on Movie to help out with this

3

Show all data from the Movie instance data on the screen. This data should have descriptive text in it.

Hint: You can use a method on Movie to help out with this.

4

Show Movie JSON output on the screen.

Hint: You can use a method on Movie to help out with this.

5

Do not call System.exit to do this.

Thank you so much for helping !!!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions