View more random threads:
- cs615 assignment no 3 spring 2011 idea solution
- CS601 Data Communication assignment no 3 idea solution...
- CS609-System Programming Assignment No. 1 idea solution 25...
- CS604 Operating Systems vu current Assignment No 5 Spring...
- CS607 Artificial Intelligence assignment no 5 idea solution...
- Cs 408 assignment 2 solution....
- CS402 Assignment No.4 Spring 2011
- CS610 Computer Network Assignment No.1 Solution Spring...
- CS614 Data Warehousing Assignment No. 01 spring April 2012
- MCM511 Theories of Communication Assignment No Fall...
CS301 Data Structures Assignment No. 2 Solution Spring 2013
Suppose three movies (Harry Potter, English Vinglish and Tekken) are on display in a cinema. Three different counters are distributing tickets for each movie. To purchase a particular movie ticket, you are required to standing the respective movie counter queue.
Considering the above scenario, write a C++ program which asks a user to choose the movie for which he/she would like to purchase a Ticket. While choosing the movie ticket, user should be asked to enter his/her social group [F for female, M for male and K for kids].
The required program functionalities should be:
Sponsored Links
> Take input for all the three movies.
> Display the total number of visitors for each movie.
> Display total revenue of cinema and total revenue of each movie (Suppose price of one ticket is 650/-).
> Display the best business earning movie of the cinema.
> Check the popularity of each movie amongst social groups (females, males or kids).
Solution Guidelines:
1) To purchase the movie ticket, viewer must have to stand in the queue. The length of the queue can vary so you have to implement queue as link list.
2) Create a class named Viewer (Node class); this class should create a node for each ticket. This class should define two private data members, social group and Next pointer. A constructor, getter and setter functions for each data member should also be defined in this class.
Note: While getting the value for social group, restrict the user to only enter f or F for female, m or M for male and k or K for kids.
3) Create another class named Mov_Que (List class); to create a queue for each movie, this class should define three variables, Front pointer, Rear pointer and counter. The class should also define the following functions:
a) Constructor(): Default constructor of the class.
b) Destructor(): Destructor to destroy the memory gained by the use of new operator.
c) add_Ticket(): This method should enter the new ticket purchased at the rear.
d) Total_Visitors(): This method should return the total number of visitors of movie.
e) Total_Revenue(): This method should return the total revenue of the movie.
f) Popularity(): This method should check the popularity of the movie amongst social group, whether the movie is popular among males, females or kids.
4) In main() function of the program, create three objects of the class Mov_Que which will act like three counters at cinema. These objects should be able to perform all the required functionalities mentioned in the question statement.
5) To get the idea about exact output of program, see Demo.wmv file attached with assignment file.
There are currently 1 users browsing this thread. (0 members and 1 guests)