Question: JAVA PROGRAMMING - So I met with someone and he suggested we use 3 string arrays. We used movies as an example for our text
JAVA PROGRAMMING -


So I met with someone and he suggested we use 3 string arrays.
We used movies as an example for our text file. Not sure what we chose in the notes but anyways that shouldnt matter.
3 String arrays
1 for movies >>> this gets read in from the text file, one line at a time. Each movie takes up a slot in the array.
1 for the input from the user, where the new movie list gets created.
1 for additional comments from the user on their rating choice.
Read in text file>>>
String array originalmovielist[] = whatever # of movies you have, which in this case, is 5.
NEEDS TO BE DYNAMIC ARRAY to account for variable numbers
String array newmovielist[] = this is where the movies go in the proper order according to the users ranking.
NEEDS TO BE A DYNAMIC ARRAY to account for variable numbers
String array comments[] = the comments from the user on their reasoning for why the movie got this rating.
Example:
When the movies get read in from the text file, they will simply be read into the array in the order they were originally written. This means that the array at this moment is arbitrary; no value to the order whatsoever. You must use a type of loop to read these into the array, while using another method to read the text into your program.
originalmovielist[0] = titanic
originalmovielist[1] = lion king
originalmovielist[2] = spiderman
originalmovielist[3] = superman
originalmovielist[4] = batman
After you have read in the String values into the first array, you then need another loop to print out these movie titles from the array, and ask the user to rank them. The rank (in this case an integer) will determine where the movies will get input into the new array list.
I would advise that you show the user the list, prior to asking them to rank, to avoid a scenario where the user wants to change their decision, or decides to try and put in the same number more than once.
int count = 0;
int rank = 0;
While (count
{
System.out.println(Rank this movie 1 through
5: + originalmovielist[count]);
Rank = system.nextln();
Newmovielist[rank 1] =
originalmovielist[count];
comments[rank 1] = scanner.in();
count++;
}
Instructions Requirements: Decide on a list of n favorites (songs, bands, movies, video games, etc.) (between 5 and 10 favorites is fine) Write a program that lists the n favorites but with a small twist. Read in a file of n favorites (sample file in the Resources/Sample File area)... Please make your own. Print a list of all n favorites to the user (so they know what is coming) Ask if the user wishes to add or delete elements to/from the list. o If they wish to add an element, read in the element from the console o If they wish to remove an element, prompt for the item to be removed. Print the next favorite from the list and for each favorite... o 1st prompt for the user's ranking of the favorite o 2nd prompt for the user's comments (for this round) Slot the favorite into the final list using the supplied flowchart Inform the user of the placement of the latest element. After all n favorites, print the list to the screen When complete, write back to the input file, adding the new comments to the previous rounds of comments. The file should be able to be consumed by your program for the next round of play . CONSOLE OUTPUT: Favorite' | Rank Comments from this round (plus all previous comments) RUBRIC Flowcharts are submitted and matches code 5 Pts Each Flowchart + 5 pts for add/delete flowchart 20 **Create flowcharts for SP-A, SP-B, SP-C AND the add/remove element functionality** Program executes as submitted 4 points A filename (or path) is stored into a variable and PROMINENTLY displayed at the TOP of the MAIN - 3 pts N favorites listed sequentially from file - 5 points User is prompted if they wish to add an element 4 pts User is prompted for the new element -4 pts New Elem User is prompted if they wish to remove an element - 4 pts User is prompted for the element to be removed 4 pts Removed element is not available for the ranking game - 4 pts N sets of user input accepted sequentially 4 points User is warned on out of range ranks or invalid input - 5 pts User is notified of correct outcome of ranking - 10 points Output List is generated after all favorites are ranked - 5 pts Output list is correct, based on flowchart algorithm - 5 pt Program writes back to the input file, adding any new elements and/or comments - 15 pts Pro 4 3 4 4 ent is used in the ranking game properly 4 4 4 4 15 gram terminates gracefully - 5 points Source code is well documented - 5 points Input & Output file (same file), can be used repeatedly, with additional comments added for cach round of play 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
