Consider a class Movie that contains the following information about a movie: * Title * MPAA Rating (e.g. G, PG, PG-13, R) * Number of people who rated this movie as a 1 Number of people who rated this movie as a 2 Number of people who rated this movie as a 3 * Number of people who rated this movie as a 4 * Number of people who rated this movie as a 5 Implement the Movie class such that it is able to contain the above information. Include a constructor that would accept two parameters and initialize the movie's title to the value of its first parameter and the movie's MPAA rating to the value of its second parameter, and public rating to 0. Also include accessor member functions for title and MPAA rating. Include a member function to increment the public rating that will only accept integer values between 1 and 5. Finally, write a member function that would return the average public rating of a movie. Write a program that would use your Movie dlass by first asking the user to input movie title and MPAA rating, then create an object using the constructor, and then allow the user to enter a space-separated list of people ratings, terminating with -1. Finally, the program will output the title of the movie, its MPAA rating, and its average public rating. SAMPLE RUN #2: ./Movie Interactive Session Hide Invisibles Hi Enter:Power - Supplye the title-of.the- movie:Enter:PG- the MPAA-rating: Enter:1.3.3.2.4.0.3.2.6-5.3.8.1.-1- space-separated-list-of- people-ratings.of-the-movie: MPAA-rating-for Power-Supply-is-PG, - and-the-average- people-rating-is-2.7.4

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Consider a class Movie that contains the following information about a
movie:
* Title
* MPAA Rating (e.g. G, PG, PG-13, R)
* Number of people who rated this movie as a 1
Number of people who rated this movie as a 2
* Number of people who rated this movie as a 3
* Number of people who rated this movie as a 4
* Number of people who rated this movie as a 5
Implement the Movie class such that it is able to contain the above
information. Include a constructor that would accept two parameters and
initialize the movie's title to the value of its first parameter and the movie's
MPAA rating to the value of its second parameter, and public rating to 0. Also
include accessor member functions for title and MPAA rating. Include a member
function to increment the public rating that will only accept integer values
between 1 and 5. Finally, write a member function that would return the average
public rating of a movie.
Write a program that would use your Movie class by first asking the user to
input movie title and MPAA rating, then create an object using the constructor,
and then allow the user to enter a space-separated list of people ratings,
terminating with -1. Finally, the program will output the title of the movie,
its MPAA rating, and its average public rating.
SAMPLE RUN #2: . /Movie
Interactive Session
Hide Invisibles
Highlight: None
Enter:Power .Supplye
the title of.the movie:Enter:PG
the MPAA -rating: Enter:1.3.3- 2.4.0.3.2.6.5.3.0.1.-14
space-separated.list.of people ratings of .the movie:MPAA -rating.for Power.Supply-is PG, · and-the average people rating-is·2.7.d
Transcribed Image Text:Consider a class Movie that contains the following information about a movie: * Title * MPAA Rating (e.g. G, PG, PG-13, R) * Number of people who rated this movie as a 1 Number of people who rated this movie as a 2 * Number of people who rated this movie as a 3 * Number of people who rated this movie as a 4 * Number of people who rated this movie as a 5 Implement the Movie class such that it is able to contain the above information. Include a constructor that would accept two parameters and initialize the movie's title to the value of its first parameter and the movie's MPAA rating to the value of its second parameter, and public rating to 0. Also include accessor member functions for title and MPAA rating. Include a member function to increment the public rating that will only accept integer values between 1 and 5. Finally, write a member function that would return the average public rating of a movie. Write a program that would use your Movie class by first asking the user to input movie title and MPAA rating, then create an object using the constructor, and then allow the user to enter a space-separated list of people ratings, terminating with -1. Finally, the program will output the title of the movie, its MPAA rating, and its average public rating. SAMPLE RUN #2: . /Movie Interactive Session Hide Invisibles Highlight: None Enter:Power .Supplye the title of.the movie:Enter:PG the MPAA -rating: Enter:1.3.3- 2.4.0.3.2.6.5.3.0.1.-14 space-separated.list.of people ratings of .the movie:MPAA -rating.for Power.Supply-is PG, · and-the average people rating-is·2.7.d
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY