Computers and Technology
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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:40, Serenitybella
When the pc version of the spreadsheet program became available, the ibm pc quickly became the top-selling personal computer?
Answers: 3
image
Computers and Technology, 22.06.2019 05:00, mathman783
Which two editions of windows 7 support 64 bit cpus? choose two out of professional, business, starter, or home premium.
Answers: 1
image
Computers and Technology, 24.06.2019 12:30, coursonianp8izbc
Do you think media is stereotype ? and why?
Answers: 1
image
Computers and Technology, 24.06.2019 17:00, rosepetals2938
Carlos, an algebra teacher, is creating a series of powerpoint presentations to use during class lectures. after writing, formatting, and stylizing the first presentation, he would like to begin writing the next presentation. he plans to insert all-new content, but he wants to have the same formatting and style as in the first one. what would be the most efficient way for carlos to begin creating the new presentation? going under the file tab and opening the first presentation, deleting all content from each page, and adding new content going under the file tab and clicking on new in the left pane, then choosing new from existing going under the design tab and clicking on themes, then selecting the theme that was used for the first template going under the design tab and opening the template that was created for the first presentation
Answers: 2
Do you know the correct answer?
Define moviedata structure the program uses a structure named moviedata to store the following infor...

Questions in other subjects:

Konu
History, 05.03.2021 16:40
Konu
Biology, 05.03.2021 16:40
Konu
Mathematics, 05.03.2021 16:40