QuestionQuestion

1. Modify the design and implementation of the modular program using parallel arrays to allow the user to repeatedly query information about the top grossing movies for the past 10 years. Define the maximum number of movies as 10. Declare the years, earnings, budgets, titles, and ratings arrays in the main function. In the main function call a function to display a welcome message (i.e. Welcome to YourName's Movie Stats) identifying the program.
Allow the user to repeatedly query the movie information. Provide a menu that allows the user to display the average budget, the average earnings, all movie information for the movie with the highest earnings, all movie information with the lowest budget, or search for a movie by year, by name, or by rating, and display the movie information for movie(s) matching the criteria or a message if none found. Before the program exits, call another function to display a message that the results were provided by your name.

The program will repeatedly allow the user to enter the type of information to display. Display a menu to
1. Display the movie information (year, earnings, budget, title, and rating) for the year entered by the user
2. Display the movie information (year, earnings, budget, title, and rating) for the movie with the highest earnings
3. Display the movie information (year, earnings, budget, title, and rating) for the movie with the lowest budget
4. Display the average earnings for the movies
5. Display the average budget for the movies
6. Search for a movie by title (allow for partial match) and display all movie information (year, earnings, budget, title, and rating)
7. Search for movies by rating (exact match) and display all movie information (year, earnings, budget, title, and rating)
8. Display all movie information (year, earnings, budget, title, and rating) for all movies
9. Exit.
At the end of the program, call a function to display a message that the results were provided by your name.
Write functions to
• Display the welcome message
• Display the menu and return the user's menu choice
• Compute and return the average of an array of values and the number of values
• Determine and return the index of the highest value, given an array of values and the number of values
• Determine and return the index of the lowest value, given the address of an array of values and the number of values
• Display a message that the results were provided by your name
*Array declarations (with data)
int years[MAX_MOVIES] = {2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018};
double earnings[MAX_MOVIES] = {2787965087, 1066969703, 1341693157, 1518812988, 1290000000, 1104039076, 2068223624, 1153304495, 1332539889, 2048359754};
double budgets[MAX_MOVIES] = {237000000, 200000000, 250000000, 220000000, 150000000, 210000000, 245000000, 250000000, 200000000, 316000000};
char titles[MAX_MOVIES][LEN_TITLE +1] = {"Avatar", "Toy Story 3", "Harry Potter and the Deathly Hallows – Part 2", "The Avengers", "Frozen", "Transformers: Age of Extinction", "Star Wars: The Force Awakens", "Captain America: Civil War", "Star Wars: The Last Jedi", "Avengers: Infinity War"};
char ratings[MAX_MOVIES][LEN_RATING +1] = {"PG-13", "G", "PG-13", "PG-13", "PG", "PG-13", "PG-13", "PG-13", "PG-13", "PG-13"};

Function descriptions
• Display welcome message - accepts no parameters and returns no value
• Display the menu - accepts no parameters and returns the user's menu choice
• Compute average - accepts the array of values and the number of elements, returns average
• Find index of highest value (using array notation) - accepts the array of values and the number of elements, returns index of highest value
• Find the index of the lowest value (using pointer notation) - accepts the address of values and the number of elements, returns index of lowest value
• Display program credits/results by - accepts no parameters and returns no value
Include a comment containing the project description, your name, course, and date at the beginning of the source code. Include comments to document each function. (Include the function name, describe the function, the parameters, and the return value.) Include comments to document the code.
Provide a set of test data (sample input and expected results) that uses all options. Run the program on the sample input and capture the output to verify that the program runs correctly (matching the expected results).
2. To submit your assignment:
• Add a comment to the end of your source code and include your test data (sample input and expected results). (Use /* and */ to enclose the test data.)
• Copy and paste the sample runs (output) into another comment at the end of your source code. (Use /* and */ to enclose the sample runs.)

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

void seachAndDisplayMovieByRating(int years[], double earnings[], double budgets[],
       char titles [MAX_MOVIES][LEN_TITLE + 1],
       char ratings [MAX_MOVIES][LEN_RATING + 1]);

int main(void) {
    char menu_option;
    int size = 10;
    double maxEarnings;
    double minBudget;
    double avgEarnings;
    int years[MAX_MOVIES] = {
       2009, 2010, 2011, 2012,
       2013, 2014, 2015, 2016,
       2017, 2018
    };
    double earnings[MAX_MOVIES] = {
       2787965087, 1066969703, 1341693157, 1518812988,
       1290000000, 1104039076, 2068223624, 1153304495,
       1332539889, 2048359754
    };
    double budgets[MAX_MOVIES] = {
       237000000, 200000000, 250000000, 220000000,
       150000000, 210000000, 245000000, 250000000,
       200000000, 316000000
    };
    char titles[MAX_MOVIES][LEN_TITLE + 1] = {
       "Avatar", "Toy Story 3",
       "Harry Potter and the Deathly Hallows – Part 2",
       "The Avengers", "Frozen",
       "Transformers: Age of Extinction",
       "Star Wars: The Force Awakens",
       "Captain America: Civil War",
       "Star Wars: The Last Jedi",
       "Avengers: Infinity War"
    };
    char ratings[MAX_MOVIES][LEN_RATING + 1] = {
       "PG-13", "G", "PG-13", "PG-13",
       "PG", "PG-13", "PG-13", "PG-13",
       "PG-13", "PG-13"
    };...

By purchasing this solution you'll be able to access the following files:
Solution.c.

50% discount

Hours
Minutes
Seconds
$50.00 $25.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats