Tuesday 4, November, 2025
Wednesday 5, November, 2025
|
|
Assignment No. 01 |
Total Marks: 20 Due Date: 04 - Nov, 2025 |
|
||
|
Instructions 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:
Uploading instructions For clarity and simplicity, you are required to Upload/Submit only ONE .cpp “ Assignment 1 Template” file after completing its code.
Note:
Learning Objectives:
· To understand and implement stack data structure using linked list · To simulate real life scenario using data structures · To learn push and pop operations logically and practically · To enhance understanding of pointer manipulation by reversing linked list connections within a stack structure For any query about the assignment, contact at cs301@vu.edu.pk
GOOD LUCK
You are working in the IT department of a School Library System, managing a stack of returned books. This system uses a Stack implemented with a Linked List to handle book returns and re-shelving. The system performs the following operations sequentially, as outlined in the provided “Assignment 1 Template.cpp” file: 1. Initialize and Display Book Stack: · Pushes 5 book titles (Book-A to Book-E) onto the stack. · Displays the books currently in the stack (before re-shelving). 2. Re-shelve Books (Pop): Automatically determines the number of books to re-shelve/pop based on the last digit of your Student ID: · If the last digit is less than or equal to 5, 2 books are re-shelved. · If the last digit is greater than 5, 3 books are re-shelved. Pops the determined number of books from the stack. Displays the updated stack after popping the books. 3. Reverse Remaining Stack: Reverse the order of the books remaining in the stack permanently, so the bottom-most book becomes the new top, and vice versa and display update stack. 4. Display Final Stack: Displays the books still remaining on the counter (after re-shelving and reversing) as final stack. Your Task to Perform:
· Implement displayBookStack() Function:
· Check sample output screenshot given below to understand program output.
Sample Output Screenshot:
|
|||||
|
Lectures Covered: This assignment covers Lecture # 01 - 06. Deadline: Your assignment must be uploaded/submitted on or before 04 November 2025. |
|||||
VuPark
Approved
Wednesday 29, October, 2025