You are required to implement the following functions using the Last In First Out data structure. Create a Student class with data-members name, regNo, department and cGpa. You are required to implement the following functions using the First In First Out (queue) data structure • Constructor – for initializing the default values of a Students • setData( ) – for setting the data in the data members from the user • isEmpty( ) – for checking whether queue of students is empty • isFull( ) – for checking whether queue of students is full • enqueue( ) – for inserting a student in a queue. If the queue is full, you are required to ask the user whether he/she wants to insert even if the queue is full. If the user says yes, then re-size your queue to create a bigger queue. Also, check whether the student is already in the queue or not. If the new student is already in the stack, display the user a message stating the book is already in the queue. • dequeue( ) – for removing a student from the queue • display( ) – for displaying all the students in the queue • sortStudents ( ) – for sorting the students based on regNo (Note: it’s a queue and it must follow first in first out rule)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18SA
icon
Related questions
icon
Concept explainers
Question

You are required to implement the following functions using the Last In First Out data structure.
Create a Student class with data-members name, regNo, department and cGpa. You are required
to implement the following functions using the First In First Out (queue) data structure
• Constructor – for initializing the default values of a Students
• setData( ) – for setting the data in the data members from the user
• isEmpty( ) – for checking whether queue of students is empty
• isFull( ) – for checking whether queue of students is full
• enqueue( ) – for inserting a student in a queue. If the queue is full, you are required to
ask the user whether he/she wants to insert even if the queue is full. If the user says yes,
then re-size your queue to create a bigger queue. Also, check whether the student is
already in the queue or not. If the new student is already in the stack, display the user a
message stating the book is already in the queue.
• dequeue( ) – for removing a student from the queue
• display( ) – for displaying all the students in the queue
• sortStudents ( ) – for sorting the students based on regNo (Note: it’s a queue and it must
follow first in first out rule)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning