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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education