Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Process the input file When your program starts it must read all data from the file and process it . After processing the file, the
Process the input file
When your program starts it must read all data from the file and process it After processing the file, the program must print the following message to stdout
"Processed file XYZ and parsed data for M movies"
where XYZ is the name of the file that has been process and M is the number of movies whose data has been processed this will be less than than the number of lines in the file because the first line has the column headers
Eg Processed file moviessamplecsv and parsed data for movies
Interactive Functionality
Next your program should display a menus of interactive choices to the user and process the selected choice as described below. For the text of messages to print, see the section "Sample Program Execution."
Show movies released in a specified year
If the user chooses this option, then ask them to enter a year and
Display the names of all the movies released in that year, one on each line
If the data doesn't have any movies released in that year, print a message about this.
Your program can assume that the user will enter a digit integer for the year between and inclusive of these years
Show highest rated movie for each year
If the user chooses this option, then for each year for which at least one movie was released, display a movie that had the highest rating along with the year and the rating with one line per year.
In case of ties, display any one movie that had the highest rating that year.
Display the data in the form: YYYY RatingValue MovieTitle
The data doesn't have to be sorted by year or by rating value.
Eg
Avengers: Infinity War
The Avengers
Show movies and their year of release for a specific language
If the user chooses this option, ask them to enter a language and
For all movies released in the specified language
Display the year of release and the movie title, one line per movie
If the data doesn't include any movie released in this language, print a message about it
You should only do an exact match on the language entered by the user
Eg "English" shouldnt match "english"
You can assume that the length of the language string entered by the user will be less than character.
Exit
If the user choose this option, the program should exit.
Notes:
For the interaction choice if the user enters an incorrect integer ie something other than to print an error message and again present the choices to the user.
You can assume that when the program asks user to enter an integer, the user will indeed enter an integer ie you don't need to verify the data type of the user input
Don't assume that the languages in the test file will be the same as the ones that appear in the sample file.
Dont make an assumption about the number of distinct languages that can appear in the test file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started