This is a continuation of Exercise 3 from week 6 practical exercises. Import a copy of Movie.java and your main program file (from week 6) into your week 9 project in Eclipse. Modify your solution code as follows:

a. Instead of the movie data being input via the keyboard, read the movie data from the file movieplaylist.csv into

  • an array of Movie objects (the array should store a maximum of 20 Movie objects), and
  • an arrayList of Movie objects,

by using either the useDelimiter method of the Scanner class or the split method of the String class (these were discussed in the week 8 lecture).

About the csv file: Each line of text in the CSV file represents one movie object. Each data item on each line is separated by a comma. Each line of text conforms to the following format:

title,company,actor,rating,year,takings

where

  • title = movie title
  • company = production company name
  • actor = lead actor name
  • rating = Australian classification rating
  • year = year released
  • takings = gross box-office takings

b. You may assume that all of the data in the file is valid, therefore, there is no need to validate any of the data as it is read from the file into the array and arrayList.

c. After reading the data from the file into the array and arrayList, display a summary table of the data in the array and arrayList similar to the following: see image.

Test the program with different sized files with different sets of data. Make sure your code works correctly if the file isn't found, if it exists but doesn't have any data in it, or, if the file has too many values to fit into the array. Your solution must incorporate appropriate methods utilising appropriate parameter passing.

Class file name: The name of the class files should be Movie and MovieFileDemo

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.