Education In Pakistan

Papers, Notes, Books & Help For Students


Tag: Assignment No. 02 SEMESTER Spring 2013 CS301‐ Data Structures

VU,Assignment No. 02 SEMESTER Spring 2013 CS301‐ Data Structures

VU,Assignment No. 02 SEMESTER Spring 2013 CS301‐ Data Structures

Assignment No. 02 SEMESTER Spring 2013 CS301‐ Data Structures
Total Marks: 20
Due Date: 02/05/2013
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
The assignment is submitted after due date.
The submitted code does NOT compile.
The submitted assignment is other than .CPP file.
The submitted assignment does NOT open or file is corrupted.
The assignment is copied (from other student or ditto copy from handouts or internet).
Uploading instructions
For clarity and simplicity, You are required to Upload/Submit only ONE .CPP file.
Don’t wait for grace day. Grace day is only given if there is problem on due date. Submit your solution within due date.
Note that no assignment will be accepted through email if there is any problem on grace day.
Note: Use ONLY Dev‐C++ IDE.
The objective of this assignment is
To make you familiar with queue and linked list data structure and programming techniques to implement queue as linked list.
For any query about the assignment, contact at
Marks: 20
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 stand in 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:

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:
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.
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.
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:
Constructor(): Default constructor of the class.
Destructor(): Destructor to destroy the memory gained by the use of new operator.
add_Ticket(): This method should enter the new ticket purchased at the rear.
Total_Visitors(): This method should return the total number of visitors of movie.
Total_Revenue(): This method should return the total revenue of the movie.
Popularity(): This method should check the popularity of the movie amongst social group, whether the movie is popular among males, females or kids.
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.
Lectures Covered: This assignment covers Lecture # 6‐9
Deadline: Your assignment must be uploaded / submitted on / before, Thursday May 02, 2013.

VU,Assignment No. 02 SEMESTER Spring 2013 CS301‐ Data Structures

Education In Pakistan © 2016