Practice Assignment MVC
Practice Assignment MVC
Dear students we will be using auto-grading tools, so failure to submit according to the below format
would result in zero marks in the relevant evaluation instrument.
i. For each question in your assignment, make a separate cpp file e.g. for question 1, make
ROLL-NUM_Q#.cpp (24i-0001_Q1.cpp) and so on. Each file that you submit must contain
your name, student-id, and assignment # on top of the file in comments.
ii. Combine all your work in one folder. The folder must contain only .cpp files (no binaries, no
exe files etc.).
iii. Run and test your program on a lab machine before submission.
iv. Rename the folder as ROLL-NUM_SECTION (e.g. 24i-0001) and compress the folder as a zip
file. (e.g. 24i-0001.zip). do not submit .rar file.
v. Submit the .zip file on Google Classroom within the deadline.
vi. Submission other than Google classroom (e.g. email etc.) will not be accepted.
vii. The student is solely responsible to check the final zip files for issues like corrupt file, virus in
the file, mistakenly exe sent. If we cannot download the file from Google classroom due to
any reason it will lead to zero marks in the assignment.
viii. Displayed output should be well mannered and well presented. Use appropriate comments
and indentation in your source code.
ix. Correct and timely submission of the assignment is the responsibility of every student,
hence no relaxation will be given to anyone. Late Submission policy will be applied as
described in course outline.
x. Total Marks: 60.
xi. If there is a syntax error in code, zero marks will be awarded in that part of assignment.
xii. Your code must be generic.
Deadline: Deadline to submit assignment is 20th February 2025 11:00 PM. You are supposed to submit
your assignment on GOOGLE CLASSROOM. Only “.ZIP” files are acceptable. Other formats should be
directly given ZERO. Correct and timely submission of the assignment is the responsibility of every
student, hence no relaxation will be given to anyone. Late Submission policy will be applied as
described in course outline.
Tip: For timely completion of the assignment, start as early as possible.
Plagiarism: Plagiarism is not allowed. If found plagiarized, you will be awarded zero marks in the
assignment (copying from the internet is the easiest way to get caught).
Note: Follow the given instruction to the letter, failing to do so will result in a zero.
NATIONAL UNIVERSITY OF COMPUTER & EMERGING SCIENCES ISLAMABAD
Here is the list of all ticket prices for night matches in Rawalpindi Cricket Stadium.
27 February 2020 | Islamabad United v Quetta Gladiators (7 pm-10.15 pm)
(VIP – Rs. 3000, Premium – Rs. 1500, First-class – Rs. 1000, General – Rs. 500)
28 February 2020 | Peshawar Zalmi v Lahore Qalandars (7 pm-10.15 pm)
(VIP – Rs. 3000, Premium – Rs. 1500, First-class – Rs. 1000, General – Rs. 500)
29 February 2020 | Islamabad United v Peshawar Zalmi (7 pm-10.15 pm)
(VIP – Rs. 3000, Premium – Rs. 1500, First-class – Rs. 1000, General – Rs. 500)
1 March 2020 | Islamabad United v Karachi Kings (7 pm-10.15 pm)
(VIP – Rs. 2000, Premium – Rs. 1000, First-class – Rs. 500, General – Rs. 250)
NATIONAL UNIVERSITY OF COMPUTER & EMERGING SCIENCES ISLAMABAD
Here is the list of all ticket prices for day matches in Rawalpindi Cricket Stadium.
7 March 2020 | Peshawar Zalmi v Islamabad United (2 pm-5.15 pm)
(VIP – Rs. 2000, Premium – Rs. 1000, First-class – Rs. 500, General – Rs. 250)
8 March 2020 | Multan Sultans v Islamabad United (2 pm-5.15 pm)
(VIP – Rs. 1500, Premium – Rs. 1000, First-class – Rs. 500, General – Rs. 250)
The program should start by displaying a menu listing the schedule of matches in the
stadium.
1. 27 Feb 2020 – Islamabad United v Quetta Gladiators, Pindi Cricket Stadium
(7pm-10.15pm)
2. 28 Feb 2020 – Peshawar Zalmi v Lahore Qalandars, Pindi Cricket Stadium
(8pm-11.15pm)
3. 29 Feb 2020 – Islamabad United v Peshawar Zalmi, Pindi Cricket Stadium
(7pm-10.15pm)
4. 1 Mar 2020 – Islamabad United v Karachi Kings, Pindi Cricket Stadium
(7pm-10.15pm)
5. 2 Mar 2020 – Peshawar Zalmi v Karachi Kings, Pindi Cricket Stadium
(7pm-10.15pm)
6. 5 Mar 2020 – Peshawar Zalmi v Quetta Gladiators, Pindi Cricket Stadium
(7pm-10.15pm)
7. 7 Mar 2020 – Peshawar Zalmi v Islamabad United, Pindi Cricket Stadium
(2pm-5.15pm)
8. 8 Mar 2020 – Multan Sultans v Islamabad United, Pindi Cricket Stadium
(2pm-5.15pm)
Enter your choice (1 - 8)
When a user selects one of the above options, a sub-menu is shown listing names of all the
enclosures, their class, ticket price and number of seats available . The available seats are
randomly
generated for each enclosure within its range of maximum capacity. When the user selects one of
the enclosures in the sub-menu, the programs prompts the user if he/she wishes to buy tickets for
a family. In case, the family option is selected - the user is prompted to enter the required number
of adult and children tickets, his/her CNIC number (maximum 4 adults, and 5 children). If the
family option is not selected, the user is prompted to enter the required number of adult tickets,
NATIONAL UNIVERSITY OF COMPUTER & EMERGING SCIENCES ISLAMABAD
his/her CNIC number (maximum 8 adults). To attract more spectators, the company is giving
discounts for groups and children. If the user selects family option or enters adult tickets greater
than four, 10% rebate is given on all adult tickets. A child ticket is given 20% rebate. The
program
finally displays the total amount due.
You have to write this program using switch statements primarily. Hint: For one and two-way
selections (e.g. input validations), you are allowed (and encouraged) to use if statements.
Input Validation: Make sure the user cannot select invalid options in the menu and that the
number of people is always greater than 0. Similarly, a user cannot enter more than available
tickets
for the chosen option. For family option, the number of children needs to be always greater than
one.
Note: use rand() to generate random numbers
NATIONAL UNIVERSITY OF COMPUTER & EMERGING SCIENCES ISLAMABAD
NATIONAL UNIVERSITY OF COMPUTER & EMERGING SCIENCES ISLAMABAD
Enjoy Coding