Oh no! Our experts couldn't answer your question.
Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.
Submit your question and receive a step-by-step explanation from our experts in as fast as 30 minutes.
You have no more questions left.
Message from our expert:
Our experts are unable to provide you with a solution at this time. Try rewording your question, and make sure to submit one question at a time. We've credited a question to your account.
Your Question:
15.11 LAB: Movie show time display
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 (|) 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.csvand 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,Rthe output of the program is:
Wonders of the World | G | 16:40 20:00 Journey to Space | PG-13 | 19:00 Buffalo Bill And The Indians or Sitting Bull | PG | 12:45 15:00 19:30 Adventure of Lewis and Clark | PG-13 | 10:00 14:30 Halloween | R | 19:00Want to see the full answer?
Check out a sample Q&A hereKnowledge Booster
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
- Computer Science csv file "/dsa/data/all_datasets/texas.csv" Task 6: Write a function "county_locator" that allows a user to enter in a name of a spatial data frame and a county name and have a map generated that shows the location of that county with respect to other counties (by using different colors and/or symbols). Hint: function(); $county ==; plot(); add=TRUE.arrow_forward7. World Series Winners In this chapter's source code folder (available on the Computer Science Portal at www. pearsonhighered.com/gaddis), you will find a text file named WorldSeriesWinners. txt. This file contains a chronological list of the World Series' winning teams from 1903 through 2009. The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. (Note the World Series was not played in 1904 or 1994. There are entries in the file indicating this.) Write a program that reads this file and creates a dictionary in which the keys are the names of the teams, and each key's associated value is the number of times the team has won the World Series. The program should also create a dictionary in which the keys are the years, and each key's associated value is the name of the team that won that year. The program should prompt the user for a year in the range of 1903 through 2009. It should then display the name of the…arrow_forwardinstruction- This file should have multiple lines, each line has first name, last name followed by multiple integers “data.txt” file Samantha Johns 43, 32,99, 79, 85 Michael Smith 98, 84, 70, 100, 76, 81 John Michael 82,92, 92 Mary Hernandez 88, 91, 92, 79, 78 George Johnson 92,93,75 Sara Anderson 83,74. Susan John 78, 84,65, 71,81 Mark Smith 69, 67,59,62arrow_forward
- 1. Display Function Implement a function to display the contents of the patient_list array. Add code to call this function. Note that there are multiple places where this function needs to be called. Look for the // TODO comments to find the correct locations. Compile and test your program. Make sure that your output is formatted similarly to the sample output shown at the end of this document. The sorting part does not need to work yet. Take a screenshot of a sample output and upload the picture as part of your assignment submission. 2. Sorting the array by Age Implement the code to sort the contents of the patient_list array based on the value stored in the age field. To do this you will need to implement code that relies on the qsort function from the C Standard library(see http://www.cplusplus.com/reference/cstdlib/qsort/). As shown in the reference, this code requires two parts: A function that compares two patient elements, based on the value stored in the age…arrow_forwardInput data file and 2D array containing data The data file is in csv (comma separated values) format. Files in csv format are plain text files that store data by delimiting data entries with commas. The data file has the following format: 1 line containing an integer with the number of communities in the file, call this number n. n lines of communities. Each line contains 22 values with the following information about the community: the percentage (value between 0 and 1.0) of Black people. the percentage (value between 0 and 1.0) of American Indian and Alaska Native people. the percentage (value between 0 and 1.0) of Asian people. the percentage (value between 0 and 1.0) of Native Hawaiian and Pacific people. the percentage (value between 0 and 1.0) of people with two or more races. the percentage (value between 0 and 1.0) of White people. the percentage (value between 0 and 1.0) of Hispanic or Lantix. the percentage (value between 0 and 1.0) of other races not listed. the…arrow_forward3 نقاط * To plot two curves on the -:same figure area (hold on) is the command used between two plot statements. a loop that runs two times is used. the number (2) is placed before the command (plot). the command (clc) is used between two plot statements. a two dimensional matrix is used. هذا السؤال مطلوب Darrow_forward
- C++ arrays task The scientist monitors the movement of a particle suspended on the surface of the water and records its coordinates every n seconds. make a program that calculates the minimum, average, and maximum velocities of the particle and the distance traveled by the particle. The first line of the original data file contains the number of particle coordinates m (1 <m <100) and the coordinate capture interval in n (n> 0) seconds. The following lines show the particle coordinates xi and yi (1 <i <m) in millimeters (xi and yi are real numbers). Record the minimum, average, and maximum velocities of the particle and the distance traveled by the particle in the result file.arrow_forwardRecently got answer It was incorrect and incomplete Copy code is strictly prohibited Thank youarrow_forwardBASH FLOW CHART: Create a flow chart to describe an algorithm that takes a text file with format ID,FirstName,Last Name,Street,City and appends a user ID field consisting of a C followed by theemployee ID. For example, the first entries in Lab 2's employees.txt are:0,Douglas L,Eberhard,Addenda Circle,Cornwall1,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough2,Bailey Rae,Lopez,Turnagain Street,Sault Ste. MarieAfter processing, the entries should be:0,Douglas L,Eberhard,Addenda Circle,Cornwall,C01,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough,C12,Bailey Rae,Lopez,Turnagain Street,Sault Ste. Marie,C2arrow_forward
- Code in Perl Create an array which holds a list of Video Games, consisting of title, the year it was released (guess if you don’t know) , platform (NES, XBOX One, etc) and publisher (in that order). Add at least ten albums to the list. Then, use the split function and a for or foreach loop to display the publisher followed by the title and platform for each list element.arrow_forwardc++ program to read file and output grades - file name is studentGrades.txt and the content is included in the image providedcode written so far (the middle portion is missing and will be included with the code from the following question):_____________________________________________________________________ #include <iostream>#include <fstream>#include <iomanip> using namespace std; int main(){int totalGrades; // This is the total number of test gradesint grade; // This is the student's test gradeifstream inFile; // This is a declaration of the inFile that holds all the gradesstring fileName; // This is the filename that the user will enterstring name; // This is the name of the studentint gradeCount; // This is to keep count of the number of grades enteredint hwGradesN; // Number of homework gradesint hwGradesV; // Homework grade valuesint hwGradesP; // Homework grade percentageint progGradesN; // Number of program gradesint progGradesV; // Program grade valuesint…arrow_forwardAssignment Write a program that will read several abbreviations given as std:string values until the value of "END" is given. After reading each abbreviation, the program will check if the same abbreviation already exists in a data base. If not, it will add this new abbreviation to the correct row of the data base. The abbreviation data base will be composed of a 2D std:string array with 3 rows and 20 columns. Abbreviations starting with digits will be kept in the first row, abbreviations starting with a lower case letter between 'a' and 'm' will be kept in the second row, and abbreviations starting with a lower case letter between 'n' and 'z' will be kept in the third row. After checking over all the input, the program will write the data base to the screen as seen in the examples below. NOTE: For each row there can be no more than 20 abbreviations. You do NOT need to check this in the input. NOTE: You MUST use a 20 String array to keep all the database in this question. HINT: For…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning