Write a program that stores dynamically allocated array of Movie (using calloc() function). Movie is the Structure with seven fields: name, genre (science fiction – action – drama/love), ticketPrices, list of actors/actresses, ratings(number of tickets sold), cost of production and profit. In program implementation user enters the following: Movie Name Movie1 Movie2 Movie3 Genre Science Fiction Action Drama-Love List of Actors /Actresses Ratings(number of tickets sold) 720 750 300 Ticket Prices $45.3 $50.2 $2.3 Cost of production $5000.5 $7000.1 $100 Net Profit - Print the Movie names, list of actors/actresses, ratings(number of tickets sold), ticket prices, cost of production and the total net profit of each movie(net_profit_of_movie) - Write a function that calculates the net_profit_of_movie; which is the multiplication of ticket prices and ratings(number of tickets sold), subtracted by cost of production - In main call function, print all movies’ information and the net_profit_of_movie to the console. - Create a file called txt and write all movies information to the file, including the net_profit_of_movie per movie. -Ask the user to add more movies (use realloc). The user needs to write at least 1 more movie (e.g. movie 4) then get all information for the new movies from the user. Create a file called txt and write all movie data including the lately added movies’ data onto the file UpdatedMovies.txt. - Write your firstname (Mohammad) at the top of the code. - Write explanatory comments for your code please make sure the answer is correct 100%
- Write a program that stores dynamically allocated array of Movie (using calloc() function). Movie is the Structure with seven fields: name, genre (science fiction – action
– drama/love), ticketPrices, list of actors/actresses, ratings(number of tickets sold), cost of production and profit.
- In program implementation user enters the following:
Movie Name |
Movie1 |
Movie2 |
Movie3 |
Genre |
Science Fiction |
Action |
Drama-Love |
List of Actors /Actresses |
|
|
|
Ratings(number of tickets sold) |
720 |
750 |
300 |
Ticket Prices |
$45.3 |
$50.2 |
$2.3 |
Cost of production |
$5000.5 |
$7000.1 |
$100 |
Net Profit |
|
|
|
- Print the Movie names, list of actors/actresses, ratings(number of tickets sold), ticket prices, cost of production and the total net profit of each movie(net_profit_of_movie)
- Write a function that calculates the net_profit_of_movie; which is the multiplication of ticket prices and ratings(number of tickets sold), subtracted by cost of production
- In main call function, print all movies’ information and the net_profit_of_movie to the console.
- Create a file called txt and write all movies information to the file, including the net_profit_of_movie per movie.
-Ask the user to add more movies (use realloc). The user needs to write at least 1 more movie (e.g. movie 4) then get all information for the new movies from the user. Create a file called txt and write all movie data including the lately added movies’ data onto the file UpdatedMovies.txt.
- Write your firstname (Mohammad) at the top of the code.
- Write explanatory comments for your code
please make sure the answer is correct 100%

Step by step
Solved in 2 steps









