CS301 Assignment No 1 Solution Spring 2020 | Virtual University |

Опубликовано: 22 Апрель 2026
на канале: FAST Education System
1,505
11

Question CS 301 Assignment 1 Spring 2020 Virtual University :
You are required to write a program in C++ to implement Stack data structure and use this data structure to store different types of books based on their identity number. You have to implement Stack data structure using array. A stack is a LIFO structure in which data elements are stored in an order such that last element pushed on the stack will be popped up first. Your program should cover the following scenario. Suppose a student is collecting books and throwing them into stack of books. You need to develop an application that will count different books in the stack. This stack will consist of three types of books i.e. software, hardware and other books. You will identify book with unique numeric identity number. If book identity number will fully dividable by 8, will consider it software book. While the number fully dividable by 5 will consider it hardware book and consider rest of the books as other books.

First, the program will ask the user to input size of the stack. Then the programmer will ask the user to input total number of books. Then according to the number of Books, it will ask the user to enter identity number for each book. The book identity number can be any random number between 1 and 99. If book identity number is fully dividable by 8, we will consider it software book. While the number fully dividable by 5 will consider it hardware book and consider rest of the books as other books.
Programmer should implement isFull() function of the stack to check if the number of books exceed the size of the stack and isEmpty() function to check if the stack is empty or not. Programmer should also display the message “Books not found” if no books found


Solution Guidelines:
1. First understand the code given in handouts about stack.
2. Get stack size from user to allocate space for stack dynamically.
3. Get identity number of books that user want to enter into the stack.
4. Get value one by one and push into stack.
5. Don’t allow popping if stack is empty and pushing if stack is full.
6. If identity number of book is dividable by 8 and 5 then priority should be given to 8

Complete Guidance CS301 Assignment No 1 Spring 2020 Virtual University

✅Don't Forget to LIKE 👍 SUBSCRIBE 🔔️️️ SHARE ↗️

Support Me 👍 Subscribe Our Official YouTube Channel:   / @teamfastacademy  

#CS301
#CS301AssignmentNo1Spring2020
#CS301Assignment1
#FASTScienceAcademy
#FASTAcademy
#FASTIAN
#This_is_for_you