Define a class movieMagic in C++ with the following description: (Self Practice)
Private members:
year //integer data member to store the year of release
title //string data member to store the title of the movie
rating //float data membmer to store the popularity rating of movie.
//(minimum 0.0 and maximum rating 5.0)
Status //String to store the result of movie status such as Flop, Super Hit, Hit, Semi-Hit.
Result() //Function to store status on following condition
Rating Status
0 to 2 Flop
2.1 to 3.4 Semi-Hit
3.5 to 4.5 Hit
4.6 to 5.0 Super-Hit
Public members:
movieMagic() //default constructor to initialize numeric data members to 0 and string members as ""
Accept() //Member function to input and store Year, Title and Rating.
Display() //To display the title of movie, year, rating and call the function Result to store the status value.
year //integer data member to store the year of release
title //string data member to store the title of the movie
rating //float data membmer to store the popularity rating of movie.
//(minimum 0.0 and maximum rating 5.0)
Status //String to store the result of movie status such as Flop, Super Hit, Hit, Semi-Hit.
Result() //Function to store status on following condition
Rating Status
0 to 2 Flop
2.1 to 3.4 Semi-Hit
3.5 to 4.5 Hit
4.6 to 5.0 Super-Hit
Public members:
movieMagic() //default constructor to initialize numeric data members to 0 and string members as ""
Accept() //Member function to input and store Year, Title and Rating.
Display() //To display the title of movie, year, rating and call the function Result to store the status value.
No comments
Post your comments