Computer Science, asked by raginis119, 6 months ago

Design a class Movie
Data members
N - to store number of tickets
rate - to store normal rate of 1 ticket
amount - to store total amount of N tickets
time - to store movie show time in 24 hour format like 1,……,10,11,12,13,14,15....22

Member functions:
Movie(int n, int time) constructor to initialise the data members with the passed parameters( number of tickets and time of show). Initialize rate of one ticket by Rs.100 void fixPrice() If the time greater than 12 then increase price of ticket by 25%
void compute() to compute the total amount to be paid for N number of tickets using rate of ticket. Use function fixPrice() to fix the ticket price according to show time void display() to display all data members with proper messages Design main function calling using object.

Answers

Answered by freedarajesh2003
1

Answer:

Explanation:

A movie theater (American English),[1] cinema (British English),[2] or cinema hall (Indian English),[3] also known as a picture house, the pictures, picture theatre or the movies, is a building that contains auditoria for viewing films (also called movies) for entertainment. Most, but not all, theaters are commercial operations catering to the general public, who attend by purchasing a ticket. Some movie theaters, however, are operated by non-profit organizations or societies that charge members a membership fee to view films.

The film is projected with a movie projector onto a large projection screen at the front of the auditorium while the dialogue, sounds and music are played through a number of wall-mounted speakers. Since the 1970s, subwoofers have been used for low-pitched sounds. In the 2010s, most movie theaters are equipped for digital cinema projection, removing the need to create and transport a physical film print on a heavy reel.

A great variety of films are shown at cinemas, ranging from animated films to blockbusters to documentaries. The smallest movie theaters have a single viewing room with a single screen. In the 2010s, most movie theaters had multiple screens. The largest theater complexes, which are called multiplexes—a concept developed in Canada in the 1950s — have up to thirty screens. The audience members often sit on padded seats, which in most theaters are set on a sloped floor, with the highest part at the rear of the theater. Movie theaters often sell soft drinks, popcorn, and candy, and some theaters sell hot fast food. In some jurisdictions, movie theaters can be licensed to sell alcoholic drinks.

Design a class Movie that contains information about a movie. The class has the following attributes (member variables):

The movie name

The MPAA rating (for example, G, PG, PG-13, R)

The number of people that have rated this movie as a 1 (Terrible)

The number of people that have rated this movie as a 2 (Bad)

The number of people that have rated this movie as a 3 (OK)

The number of people that have rated this movie as a 4 (Good)

The number of people that have rated this movie as a 5 (Great)

The class should have the following member functions:

A constructor that allows the programmer to create the object with a specified name and MPAA rating. The number of people rating the movie should be set to 0 in this constructor.

A destructor which is automatically executed whenever an object of the class is destroyed.

Accessor and mutator functions for the movie name and MPAA rating

A function addRating that takes an integer as an input parameter. The function should verify that the parameter is a number between 1 and 5, and if so, increment the number of people rating the movie that match the input parameter. For example, if 3 is the input parameter, then the number of people that rated the movie as a 3 should be incremented by 1. If the user entered a parameter value not between 1 and 5, he/she should be prompted to re-enter a correct value.

A function getAverage that returns the average value for all of the movie ratings.

(Separate the class code into a header file (Movie.h) and an implementation file (Movie.cpp)).

b). (30pts) Test the class by writing a main function that creates an array of three movie objects by calling the constructor, adds at least five ratings for each movie (ideally the ratings are from the user input), and outputs the movie name, MPAA rating, and average rating for each movie object.

Similar questions