Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a class RatingScore that represents a numeric rating for something such as a movie. Its attributes are -The description of what is being rated

Consider a class RatingScore that represents a numeric rating for something such as a movie.

Its attributes are

-The description of what is being rated

-The maximum possible rating

-The rating

It will have methods to

-Get the rating from a user

-Return the maximum rating possible

-Return the rating

-Return a string showing the rating in a format suitable for display

Note: The program should have logic to handle the case if the user enters an input greater then

the max possible rating.

Write a driver program that displays the functionality of the program.

hint

RatingScore movieRating = new RatingScore();

movieRating.initialize("Joe's excellent movie", 5);

RatingScore restaurantRating = new RatingScore();

restaurantRating.initialize("Food quality", 10);

Ex)

Standard Output: What is your rating for Joe's excellent movie?

Standard Output: Please enter an integer from 0 to 5

Standard Input: 3

Standard Output: Displaying the rating for the movie.

Standard Output: The rating is 3/5 for Joe's excellent movie

Standard Output: What is your rating for Food quality?

Standard Output: Please enter an integer from 0 to 10

Standard Input: 9

Standard Output: Displaying the rating for the restaurant.

Standard Output: The rating is 9/10 for Food quality

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions