Question: Write a program that reads movie data from a CSV ( comma separated val - ues ) file and output the data in a formatted

Write a program that reads movie data from a CSV (comma separated val-
ues) file and output the data in a formatted table.
1 The Challenge
The program first reads the name of the CSV file from the user.
The program then reads the CSV file and outputs the contents according
to the following requirements:
each row contains the title, rating, and all showtimes of a unique
movie.
A space is placed before and after each vertical separator ('-') in
each row.
Column 1 displays the movie titles and is left justified with a mini-
mum of 44 characters.
If the movie title has more than 44 characters, output the first 44
characters only.
Column 2 displays the movie ratings and is right justified with a
minimum of 5 characters.
Column 3 displays all the showtimes of the same movie, separated
by a space.
Each row of the CSV file contains the showtime, title, and rating of a
movie.
Each row of the CSV file contains the showtime, title, and rating of a
movie.
2 Input
Name of the csv file
3 Output
Movie data in a formatted table
4 CSV Format
16:40, Wonders of the World,G
20:00, Wonders of the World,G
19:00,Journey to Space,PG-13
12:45,Buffalo Bill And The Indians or Sitting Bull's History Lesson,PG
15:00,Buffalo Bill And The Indians or Sitting Bull's History Lesson,PG
19:30,Buffalo Bill And The Indians or Sitting Bull's History Lesson,PG
10:00,Adventures of Lewis and Clark,PG-13
14:30,Adventures of Lewis and Clark,PG-13
19:00, Halloween, R
5 Example
 Write a program that reads movie data from a CSV (comma

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!