Question
The data for four movies can be found in the plain text file movieData.txt . (This data was obtained from imdb.com.) The moves are listed
The data for four movies can be found in the plain text file movieData.txt. (This data was obtained from imdb.com.) The moves are listed in chronological order with a blank line between each movie.
Use get(), getline() and ignore() as needed to read the needed pieces of data from the movie data file. Any data that is not needed should be ignored rather than read. Keep a running total of the estimated budgets, worldwide grosses and runtimes and store as the last line of the table. Calculate the approximate profit for each movie and the summation. Calculate the number of years between the last movie and the first movie.
The provided movieData.txt file would produce the table found in the provided movieInfo.txt file. Make use of the iomanip library to format the table (rather than escape sequences). Display the monetary values using commas; the years should display without commas. The table will exceed 80 characters.
Challenge: The release date should be in standard US format (Month day, year) and should be output as a single entity in the column for the release date.
movieData.txt:
The Avengers Release Date: 4 May 2012 (USA) See more Also Known As: Group Hug See more Filming Locations: Pittsburgh, Pennsylvania, USA See more Budget: 220000000 (estimated) Opening Weekend USA: 207438708 Gross USA: 623357910 Cumulative Worldwide Gross: 1518812988 Production Co: Marvel Studios, Paramount Pictures See more Runtime: 143 min | 173 min (extended cut)
Avengers: Age of Ultron Release Date: 1 May 2015 (USA) See more Also Known As: The Avengers 2 See more Filming Locations: Shepperton Studios, Shepperton, Surrey, England, UK See more Budget: 250000000 (estimated) Opening Weekend USA: 191271109 Gross USA: 459005868 Cumulative Worldwide Gross: 1402805868 Production Co: Marvel Studios, Walt Disney Pictures See more Runtime: 141 min
Avengers: Infinity War Release Date: 27 April 2018 (USA) See more Also Known As: The Avengers 3 See more Filming Locations: Pinewood Atlanta Studios - 461 Sandy Creek Road, Fayetteville, Georgia, USA See more Budget: 321000000 (estimated) Opening Weekend USA: 257698183 Gross USA: 678815482 Cumulative Worldwide Gross: 2048359754 Production Co: Marvel Studios, Jason Roberts Productions, South Pictures See more Runtime: 149 min
Avengers: Endgame Release Date: 26 April 2019 (USA) See more Also Known As: Avengers 4 See more Filming Locations: Atlanta, Georgia, USA See more Budget: 356000000 (estimated) Opening Weekend USA: 357115007 Gross USA: 858373000 Cumulative Worldwide Gross: 2797800564 Production Co: Marvel Studios See more Runtime: 181 min
movieInfo.txt:
Movie Information Title Released Runtime (min) Estimated Budget Worldwide Gross Approximate Profit ------------------------------------------------------------------------------------------------------------------------ The Avengers May 4, 2012 143 220,000,000 1,518,812,988 1,298,812,988 Avengers: Age of Ultron May 1, 2015 141 250,000,000 1,402,805,868 1,152,805,868 Avengers: Infinity War April 27, 2018 149 321,000,000 2,048,359,754 1,727,359,754 Avengers: Endgame April 26, 2019 149 356,000,000 2,147,483,647 1,791,483,647 ======================================================================================================================== Summation across 7 years 582 1,147,000,000 7,117,462,257 5,970,462,257
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started