Simple Expressions 5

Description

Using basic expressions, receiving user input, display values of different data types.

Requirements

  1. Declare a string called movie_name.
  2. Declare a string called mpaa_rating.
  3. Declare int’s called release_year, ratings_count
  4. Declare double’s called current_rating, user_rating, new_rating
  5. Declare a char called region
  6. Ask the user to enter the name of a movie. Use movie_name  to receive this from the user. Make sure you allow movie names with spaces.
  7. Ask the user to enter the MPAA rating. Use mpaa_rating to receive this from the user. (MPAA Rating examples, PG-13, R, PG, etc)
  8. Ask the user to enter the release year. Use release_year to receive this from the user.
  9. Ask the user to enter the current ratings score. Use current_rating to receive this from the user
  10. Ask the user to enter the current number of ratings. Use ratings_count to receive this from the user.
  11. Ask the user to enter the movie’s region. Use region to receive this from the user. See sample interaction below on what text to display when asking for region. 
  12. Ask the user to enter their own rating score. Use user_rating to receive this from the user.
  13. Calculate the new rating, using the previous rating score and count. Factor in the user’s new rating. Store this calculated value in new_rating. See below for how to calculate new_rating:
    ((current_rating * ratings_count) + user_rating) / (ratings_count + 1)
    
  14. Display the program’s output as shown in the Sample Interaction below.

DO NOT USE

You may not use any conditional constructs such as the IF statement

Sample Interaction / Output

Enter name of movie: Coming To America
Enter MPAA rating: R
Enter release year: 1988
Enter current ratings score: 7.5
How many ratings so far? 5

1-US/Canada, 2-Japan/Europe/S.Africa/Middle East, 3-Asia
In what region is it available? 1

What would you rate it? 9

Coming To America (1988, R) is available in Region 1
New rating: 7.75

LEGEND
PROGRAM OUTPUT
USER INPUT
FROM INPUT

CATALOG ID: CPP-EXP0005

Print Requirements