Hello! I need help writing a C++ program which uses a data structure class calle
ID: 3657402 • Letter: H
Question
Hello! I need help writing a C++ program which uses a data structure class called Movie. this class has a title, rating, and lastly profit data members. I also need create an array of movie objects in my main function.
The program will ask the user for their choice, then it execute's the choice they made. The choices are below. the choices are a function in the main. I need methods to access the data member fields of the movie object.
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
Below is the file of movies I will be reading from.
Explanation / Answer
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 #include #include using namespace std; const int SIZE = 50; struct MovieData { char title[SIZE]; char director[SIZE]; int year; int minutesRunning; }; void GetMovieInfo(MovieData&); void MovieDisplay(MovieData); int main() { MovieData member1, member2; GetMovieInfo(member1, member2); MovieDisplay(member1, member2); return 0; } void GetMovieInfo(MovieData &m1, &m2) { //Get movie title coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.