subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
It is not a good idea in a cover letter to mention another person whom the employer knows.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 23.06.2019 09:50
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
You know the right answer?
Define moviedata structure the program uses a structure named moviedata to store the following infor...
Questions
question
History, 17.04.2020 23:35
question
English, 17.04.2020 23:35
question
Mathematics, 17.04.2020 23:35
question
Mathematics, 17.04.2020 23:35
Questions on the website: 13722359