Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java Assume that a list of movies produced in different years are listed in a text file. Assume that the name of the text
In Java
Assume that a list of movies produced in different years are listed in a text file. Assume that the name of the text file is "movies.txt". For example, here is some set of movies. Please feel to add, change, edit the test data. Fargo, 1970 Wanda, 1970 Airport, 1970 Red Sun, 1971 Solaris, 1971 Fargo, 1990 Airport, 1981 Tenet, 2020 You will write a program To read this text file To construct a movie object with two fields (name and year_made) for each line read To construct a collection of movies (ArrayList, arra[ ], vector) To ask the user for inputting a movie name as well as the year in which it is made. To update the file with this movie only if (the movie and the year) does not exist in the file. For example, here is a sample output of the program if there is no such movie in the file (Test Case 1) Enter the movie: tenet Enter the year: 2020 Movie doesn't exist in the file. Movie is added to the "movies.txt" (Test Case 2) Enter the movie: fargo Enter the year: 1970 Error! This movie already exist in the movieStep 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