Computers and Technology, 11.12.2019 22:31 abiszcz21
Define moviedata structure the program uses a structure named moviedata to store the following information about a movie: movie title director (name stored in the format: lastname, firstname) year released (stored in the format: ) running time (in minutes) cost of production revenue generated profit or loss (calculated field) define this structure now. function readandcalculate the function readandcalculate should read the movie data into a vector. each line of the input file contains the name of the movie, the name of the director, the year of release, running time, cost of production, and revenue generated, with each piece of data separated by a semi-colon (; ). there is no sentinel. example input file moviedata. txt the lord of the rings: the fellowship of the ring; jackson, peter; 2001; 178; 93; 871530324 star wars episode i: the phantom menace; lucas, george; 1999; 136; 115; 1027044677 2001: a space odyssey; kubrick, stanley; 1968; 142; 12; 1907 tron; lisberger, steven; 1982; 96; 17; 33 blade runner; scott, ridley; 1982; 117; 28; 32868943 d. a.r. y.l.; wincer, simon; 1985; 99; 12; 7840873 short circuit; badham, john; 1986; 98; 9; 40697761 wargames; badham, john; 1983; 114; 12; 79568000 the matrix; the wachowski brothers; 1999; 136; 63; 463517383 iron man; favreau, jon; 2008; 126; 14; 585212101
the amount of the movie's profit or loss should be determined after reading the movie's cost of production and the amount of revenue it generated; if there was a loss, the amount stored should be negative.
the code should read the data from the file and calculate the profit/loss, filling a single instance of structure moviedata; this single structure should then be added to the vector of movies. complete this function now.
function write the function write should output the information to a file, specified by a file handle via parameter, with all information for a movie on a single line with the pieces of information separated by semi-colons. see the sortedalpha. txt file provided in the starter code section of this assignment for an example of the output.
function bubblesortbyname the function bubblesortbyname should sort the movies ascending by title. this code should be very similar to the code from the tutorial. complete this function now.
function bubblesortbyprofit the function bubblesortbyprofit should sort the movies descending by profit/loss. this code will be identical to the bubblesortbyname code with only the conditional expression controlling the swap changing. complete this function now.
function displaysinglemovie the function displaysinglemovie should display the information of a single movie to the screen, with each piece of information on a line by itself. complete this function now.
function the function should determine which movie made the most profit. you may write this function one of two ways: (1) assume the movies have been sorted by profit using the bubblesortbyprofit function or (2) make no assumption as to whether the data has been sorted or not and write code that will work regardless of sorted order. this function should return the structure containing this movie's information.
expected result using moviedata. txt file the output of your program should look exactly like this. data values may differ.
movie with highest profit: star wars episode i: the phantom menace
directed by lucas, george released in 1999
running 36 minutes
cost $115,000,000.00 to produce
generated $1,027,044,677.00 in revenue
for a profit of $912,044,677.00
Answers: 1
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
Computers and Technology, 23.06.2019 19:30
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a,b] se pot scrie ca produs de două numere prime? “.
Answers: 3
Computers and Technology, 24.06.2019 06:30
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
Computers and Technology, 25.06.2019 15:00
Vote! q. what quest should i do next in the "answer anyone's question " be? a. answer 25 questions -or- b. answer 15 questions
Answers: 2
Define moviedata structure the program uses a structure named moviedata to store the following infor...
History, 21.02.2022 14:00
History, 21.02.2022 14:00
World Languages, 21.02.2022 14:00
English, 21.02.2022 14:00
Mathematics, 21.02.2022 14:00
Mathematics, 21.02.2022 14:00
Chemistry, 21.02.2022 14:00
Mathematics, 21.02.2022 14:00
History, 21.02.2022 14:00
Mathematics, 21.02.2022 14:00
Mathematics, 21.02.2022 14:00
Mathematics, 21.02.2022 14:00
History, 21.02.2022 14:00