Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions