Question: Write the C++ code using the folloing: Define a struct named MovieData to store the following information about a movie: Field Name Data Type Description

Write the C++ code using the folloing:

Define a struct named MovieData to store the following information about a movie:

Field Name Data Type Description title string Movie Title director string Movie Director yearReleased int Year Realesed runningTime double Running Time in Minutes Given functions are:

int populateIntegerArray(string *arrayPtr, int arraySize);

int findMaximumInteger(string *arrayPtr, int arraySize);

void displayIntegerArray(string *arrayPtr, int arraySize);

Process: 1) Enhaance the function to work with MovieData structs instead of integers if needed.

2) Allocate memory from an array of MovieData structs, instead of array of integers.

3) populate the array with input from the user.

4)Display the array content.

5)Find the longest movie in the array (the movie with the longest runningTime value).

sample output:

Enter desired array size: 3

arrayPtr = 0038B514

Enter Title 0: 2001:A Space Odyssey

Enter Director 0: Stanley Kubrick

Enter Year Released 0: 1968

Enter running time (minutes) 0: 142

Enter Title 1: The Sound of Music Enter Director 1: Robert Wise Enter Year Released 1: 1965 Enter running time (minutes) 1: 174 Enter Title 2: Finding Nemo Enter Director 2: Andrew Stanton Enter Year Released 2: 2003 Enter running time (minutes) 2: 100 0038B514: arrayPtr[0] = Title : 2001: A Space Odyssey Director : Stanley Kubrick Released : 1968 Running Time: 142 minutes 0038B554: arrayPtr[1] = Title : The Sound of Music Director : Robert Wise Released : 1965 Running Time: 174 minutes 0038B594: arrayPtr[2] = Title : Finding Nemo Director : Andrew Stanton Released : 2003 Running Time: 100 minutes Longest Movie in list: Title : The Sound of Music Director : Robert Wise Released : 1965 Running Time: 174 minutes Longest Movie is: 174 minutes long DELETING array at arrayPtr = 0038B514

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!