Question
Use the text file with the following data: Movie Name, duration You will be given a Movie class that will contain the 2 fields, a
Use the text file with the following data:
Movie Name, duration
You will be given a Movie class that will contain the 2 fields, a constructor to initialize the 2 fields, and a toString method. It will also have the appropriate getters and setters in the Movie class.
You will need to create a Driver class that will read the input file. You will create a Movie object per record in the file, and store the Movie object in an array of Movies. The array of Movies will be created as a static global variable, before the main method.
Write a method in the driver class that will find the movie with the longest duration and the shortest duration. The method should also add up all the movie durations, so that after the loop, you can calculate the average duration of all movies.
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