Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello I need to make this program : Use the input file provided above (oscars.tx

ID: 3643962 • Letter: H

Question

Hello I need to make this program : Use the input file provided above (oscars.txt) Write a program that opens an input file containing the number of movies showing at a movie theater. The file also contains the name of the movie, review rating, and box office profit. Your program should use a function, CreateList, to create a dynamic array of structs to hold the information contained in the file. Your program should then prompt the user for his or her choice, then execute that choice. The choices are below - each should be an individual function in your program 1) FindParticularRating: Allow a user to enter a movie name and find its rating. 2) FindHighestRating: Print the movie with highest user rating 3) FindHighestBoxOffice: Find Movie with highest box office rating 4) PrintAll: Print all the movies in the array as well as their rating and profits

Explanation / Answer

typedef struct movie{
char name[100];
int rating;
int profit;
}movie;

movie *array; // dynamic array;

void CreateList(int size){
array = (movie*)malloc(n*sizeof(movie));
Now read from the required file and store as
array[i].name, array[i].rating, array[i].profit


since array is a global array so no need to return

}

similarly write all the other functions
Simply iterate over the array to find the movie with the highest rating, with a particular rating, highest profit, and to print all
The template code would be something like

int i=0;
for(i=0;i<size;i++){
Operate on array[i];
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote