Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(3) in C language (clear and typed) Here are the given #defines and struct Here is the function I need solved Congratulations! You have been
(3) in C language (clear and typed)
Here are the given #defines and struct
Here is the function I need solved
Congratulations! You have been hired as a developer for GryphCinemas in the creation and testing of their newest 'cineGryph' movie rating software. As the sole software developer of this product, you will create a program that will allow ten (10) reviewers to rate three (3) movies. All data will be read in from external files and parsed into structs. Each of the three movies will be rated by each of the ten judges on a binary scale: Y' or 'y' will represent the notion of recommending a movie 'N' or 'n' will represent the notion of not recommending a movie The software will take the parsed reviews and determine the most "critical" reviewers as well as the highest-rated movie(s). As a means of futureproofing, this program will also predict how a movie will perform based on state-of-the-art (not really) algorithms. a #define NUMBER_REVIEWERO #define NUMBER_MOVIES 3 #define MAX_STR 50 #define MAX_WORDS 10 //the total # of movie reviewers //the total # of movies //the max length of a string //max # of words in a movie title struct reviewStruct { char reviewer [MAX_STR); int feedback [NUMBER_MOVIES]; } //struct represents one single review. //this represents the name of the reviewer //this represents each individual movie rating int getMostRecommendedMovies ( const char movieNames [NUMBER_MOVIES] [MAX_STR], const struct reviewStruct reviews [NUMBER_REVIEWERS], char mostRecommendedMovies [NUMBER_MOVIES][MAX_STR] ); This function will get a list of the most recommended movies. A recommended movie has the same amount of positive recommendations ('Y' or 'Y') as the movie which has the most amount of positive recommendations. Like getMostCriticalReviewers(), this function will return an int representing the number of recommended movies as well as return the names of each recommended movie using mostRecommendedMovies. In a similar vein of reasoning as getMostCriticalReviewers(), the movies and reviews arrays are used merely as input (i.e. they will only be read from when writing to the mostRecommendedMovies list), so you are not allowed to modify them. There are few reasons to (in this function) anyway. To look at an example of this function, examine this file: Ritu Y Ny Larry n ny Dan yyy Judi n yn Eric y yn Isabelle yn y Manisha ynn Terra Y Y N Dora n yn Nick n ny of the three movies being reviewed (each being represented by a column in the file), the highest number of 'y' reviews ("Yes, I recommend") is 6, and this occurs with the first movie (in other words, the first movie column of the three). The remaining two movies only have five 'y' reviews each, meaning only the first movie is written to mostRecommendedMovies, which would be "Star Wars" given the original movies file. The function, as such, would return 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started