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%
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)