me a proglam that Teads movie dala noIT Csv (CoI ma separated values) fme and output the data in a formatted table. 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 (1) in each row. • Column 1 displays the movie titles and is left justified with a minimum 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. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the program is: movies.csv and the contents of movies.csv are: 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, Adventure of Lewis and Clark, PG-13 14:30,Adventure of Lewis and Clark, PG-13 19:00, Halloween, R

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question

I need this in JAVA

Write a program that reads movie data from a csv (comma separated values) file and output the data in a formatted table. 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 (1) in each row.
• Column 1 displays the movie titles and is left justified with a minimum 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. Assume data of the same movie are grouped in consecutive
rows.
Ex: If the input of the program is:
movies.csv
and the contents of movies.csv are:
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,Adventure of Lewis and Clark, PG-13
14:30,Adventure of Lewis and Clark, PG-13
19:00, Halloween, R
the outnut of the program is:
Transcribed Image Text:Write a program that reads movie data from a csv (comma separated values) file and output the data in a formatted table. 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 (1) in each row. • Column 1 displays the movie titles and is left justified with a minimum 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. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the program is: movies.csv and the contents of movies.csv are: 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,Adventure of Lewis and Clark, PG-13 14:30,Adventure of Lewis and Clark, PG-13 19:00, Halloween, R the outnut of the program is:
LabProgram.java
Load default template...
1 import java.util.Scanner;
2 import java.io.FileInputStream;
3 import java.io.IOException;
4
5 public class LabProgram {
public static void main(String[] args) throws IOException {
Scanner scnr = new Scanner(System.in);
8.
9.
/* Type your code here. */
}
11 }
10
12
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
Develop mode
Submit mode
second box.
Enter program input (optional)
If your code requires input values, provide them here.
Transcribed Image Text:LabProgram.java Load default template... 1 import java.util.Scanner; 2 import java.io.FileInputStream; 3 import java.io.IOException; 4 5 public class LabProgram { public static void main(String[] args) throws IOException { Scanner scnr = new Scanner(System.in); 8. 9. /* Type your code here. */ } 11 } 10 12 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the Develop mode Submit mode second box. Enter program input (optional) If your code requires input values, provide them here.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT