Question: 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
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:
(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.
(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
(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 searchByLength(String[] titles, int[] lengths, int numDVDs, Scanner stdI
Notes and Hints:
The effective use of additional methods may help to simplify the understanding as well as implemen- tation of this assignment.
Main topics: Menu driven programming Programmer defined methods Arrays Parallel Arrav rogram 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 Movie's information must be stored in an appropriately typed array. This means vou will have two parallel arravs Your DVD Movie organizer must be able to accommodate up to 128 DVD Movies . Your program will work off of a that repeatedly, allows t 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: subStringC)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
