int actors int numActors string fName string lName

# Int actors int numactors string fname string lname

This preview shows page 3 - 5 out of 5 pages.

int searchActorByName(Actor actors[], int numActors, string fName, string lName){for(int i=0; i<numActors; i=i+1){if((actors[i].fName==fName) && (actors[i].lName==lName)){return i;}}return -1;}//This function searches the array of Movie structures for a given movie by their name. If the Movie with that name is found, the function returns the location in the array//where the movie was found. If the movie is not found, the function returns -1.int searchMovieByName(Movie movies[], int numMovies, string movieName){for(int i=0; i<numMovies; i=i+1){if(movies[i].movieName==movieName){return i;}}return -1;
}//This function searches the array of Movie structures for a given movie id. If the Movie with that movie id is found, the function returns the location in the array//where the movie was found. If the movie is not found, the function returns -1.int searchMovieById(Movie movies[], int numMovies, int movieId){for(int i=0; i<numMovies; i=i+1){if(movies[i].movieId==movieId){return i;}}return -1;}// This functions searches for a movie. If the movie is found all of the information pertaining to the movie is printed.// If it is not found an appropriate error message is printed.void option1(Movie movies[], int numMovies, string movieName){int search;for(int i=0;i<numMovies;i=i+1){search= searchMovieByName(movies,numMovies, movieName);if(search!=-1){printMovie (movies[i]);}}}//This functions searches for a movie by name and prints the list of all the actors and the roles they played in the movie.void option2(Movie movies[], int numMovies, string movieName, Actor actors[], int numActors,Cast casts[], int numEntries){}//This functions searches for an actor's name and list the name of the movie (s)and roles(s) played in the movie of all the movies the actor has acted//in if the actor exists. If the actor exists but has not acted in any of the listed movies, display "Actor has not acted in any movie."

#### You've reached the end of your free preview.

Want to read all 5 pages?