Question: Java programming, thanks! Main topics: Menu driven programming Programmer defined methods, Arrays, Parallel Arrays Program Specification: You are someone who has decided that they need
Java programming, thanks!
Main topics: Menu driven programming Programmer defined methods, Arrays, Parallel Arrays
Program Specification:
You are someone who has decided that they need to organize their DVD / Movie collection. To do so, you have decided to write a program suited to this task. For each DVD / Movie you will store and maintain its Title, and its running Length (in minutes).
title (a character string) length (a positive Integer)
The program will allow its user to add a DVD / Movie title and its running length and to display the results of various searches, in some reasonable format.
Rules and Requirements:
Each piece of a DVD / Movies information must be stored in an appropriately typed array. This means you will have two parallel arrays.
Your DVD / Movie organizer must be able to accommodate up to 128 DVD / Movies.
Your program will work off of a main menu that, repeatedly, allows it user to select from the following options:
1. (Add a DVD / Movie to the DVD / Movie Organizer)
(a) Check if the DVD / Movie Organizer is already full, if so display an appropriate message and stop here.
(b) Prompt for and read a title from the user.
(c) Prompt for and read a length from the user.
(d) Store this information into the appropriate arrays, at the appropriate location.
2. (Title Search the DVD / Movie Organizer)
(a) Prompt for and read a title search string from the user: tSStr.
(b) If tSStr does not end with the character * then you display to the screen, all of the DVD
/ Movie (titles and lengths) in the Organizer whose title exactly matches the string tSStr.
(c) If tSStr does with the character * then you display to the screen, all of the DVD / Movie (titles and lengths) in the Organizer whose title exactly matches the string tSStr up to,
but not including the index of the * in tSStr. Hint: subString()
3. (Length Search the DVD / Movie Organizer)
(a) Prompt for and read a length search string from the user: lSStr.
(b) If lSStr starts with the character < then you display to the screen, all of the DVD / Movie (titles and lengths) in the Organizer whose length is less than that specified by remaining characters of lSStr. Hint: subString(), ParseInt()
(c) If lSStr starts with the character = then you display to the screen, all of the DVD / Movie (titles and lengths) in the Organizer whose length is equal to that specified by remaining characters of lSStr. Hint: subString(), ParseInt()
(d) If lSStr starts with the character > then you display to the screen, all of the DVD / Movie (titles and lengths) in the Organizer whose length is greater than that specified by remaining characters of lSStr. Hint: subString(), ParseInt()
(e) If lSStr does not match one of the above three cases, then an appropriate error message is displayed.
4. (Quit the DVD / Movie Organizer Program) When and only when selected, your program terminates.
You must use implement the following method headings (with no modifications) and use each method in your program:
// diplay menu to the screen // prompt for and get String responce // return responce public static String menu(Scanner stdIn)
// prompt for and get a title and a length from user // add to titles and lengths arrays at index numDVDs // return numDVDs + 1 public static int addDVD(String[] titles, int[] lengths, int numDVDs, Scanner stdIn)
// prompt for and get title search string from user // diplay all matching DVD / Movies and their length to the screen public static void searchByTitle(String titles[], int lengths[], int numDVDs, Scanner stdIn
// prompt for and get length search string from user // diplay all matching DVD / Movies and their length to the screen public static void searchByTitle(String[] titles, int[] lengths, int numDVDs, Scanner stdIn
Notes and Hints:
The effective use of additional methods may help to simplify the understanding as well as implemen- tation of this assignment.
Sample run(s):
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : a
***************************
Please enter DVD title : The Fly Please enter DVD length : 124
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : a
***************************
Please enter DVD title : The Wizard of Oz Please enter DVD length : 167
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : a
***************************
Please enter DVD title : How to Fly Fish Please enter DVD length : 30
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : t
***************************
Please enter DVD title (post * allowed) : The
Title Length -----------------------------
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : t ***************************
Please enter DVD title (post * allowed) : The*
Title Length ----------------------------- The Fly 124min The Wizard of Oz 167min
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : l
***************************
Please enter DVD length (pre < = > manditory) : <100
Title Length --------------------------------------- How to Fly Fish 30min
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : l
***************************
Please enter DVD length (pre < = > manditory) : =124
Title Length --------------------------------------- The Fly 124min
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : l ***************************
Please enter DVD length (pre < = > manditory) : >124
Title Length --------------------------------------- The Wizard of Oz 167min
***************************
A Add a DVD *
T Search by Title *
L Search by Length *
Q Quit *
***************************
Please enter an option : q
***************************
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
