Q)Define a
class
named movie
Magic with
the following
description:
Instance
variables/data
members:
int year –to
store year of
release of a
movie
String title –
to store the
title of the
movie
float rating –
to store the
popularity
rating of the
movie
(minimum
rating=0.0 and
maximum
rating=5.0)
Member
methods:
(i)
movieMagic()
– Default
constructor to
initialize
numeric data
members to 0
and String
data members
to “”.
(ii) void
accept() – To
input and
store year,
title and rating
(iii) void
display() – To
display the
title of the
movie and a
message
based on the
rating as per
the table
below.
MESSAGE TO
RATING
BE DISPLAYED
0.0 to
Flop
2.0
2.1 to
Semi-hit
3.4
3.5 to Hit
4.5
4.6 to
Super hit
5.0
Write a main method to
create an object of the class
and call the above methods.