Generate the driver file (main.cpp) where you perform the following tasks. Note that you cannot make any change to the header file or the source file. Operation to Be Tested and Description of Action Create a list of integers Insert four items Print the list Print the length of the list Insert one item Print the list Retrieve 4 and print whether found or not Retrieve 5 and print whether found or not Retrieve 9 and print whether found or not Retrieve 10 and print whether found or not Print if the list is full or not Delete 5 Print if the list is full or not Delet 1 Print the list Delete 6 Print the list Write a class student Info that represents a student record. It must have variables to store the student ID, student's name and student's CGPA. It also must have a function to print all the values. You will also need to overload a few operators. . . ● · . . . . . . . . ● ● . . ● . ● . . • . Create a list of objects of class studentInfo. 4 Insert 5 student records Delete the record with ID 15467 Retrieve the record with ID 13569 and print whether found or not along with the entire record Print the list Input Values 5769 1 15234 Jon 2.6 13732 Tyrion 3.9 13569 Sandor 1.2 15467 Ramsey 2 3.1 16285 Arya 3.1 Expected Output 5769 4 57691 Item is not found Item is found Item is found Item is not found List is full List is not full 769 79 Item is found 13569, Sandor, 1.2 15234, Jon, 2..6 13732, Tyrion, 3.9 13569, Sandor, 1.2 16285, Arya, 3.1

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Urgently Please solve it with linked list.
In today's lab we will design and implement the List ADT where the items in the list are unsorted.
template <class ItemType>
void
UnsortedType<ItemType>:: RetrieveItem (ItemType&
item, bool found)
{
unsortedtype.h
#ifndef UNSORTEDTYPE_H_INCLUDED
#define UNSORTEDTYPE_H_INCLUDED
const int MAX_ITEMS= 5;
template <class ItemType>
class UnsortedType
{
1
}
public :
}
UnsortedType ();
void MakeEmpty();
bool IsFull();
int LengthIs();
void InsertItem (ItemType);
void DeleteItem (ItemType);
void RetrieveItem (ItemTypes, bools);
};
#endif // UNSORTEDTYPE_H_INCLUDED
unsortedtype.cpp
void ResetList ();
void GetNextItem (ItemTypes);
private:
#include "UnsortedType.h"
template <class ItemType>
UnsortedType<ItemType>:: UnsortedType()
}
int length;
ItemType info [MAX_ITEMS];
int currentPos;
template <class ItemType>
void UnsortedType<ItemType>::MakeEmpty()
1
length = 0;
1
template <class ItemType>
bool UnsortedType<ItemType>:: IsFull ()
{
length = 0;
current Pos = -1;
item)
return (length == MAX_ITEMS);
template <class ItemType>
int UnsortedType<ItemType>:: LengthIs ()
{
return length;
}
template <class ItemType>
void UnsortedType<ItemType>:: ResetList ()
{
current Pos = -1;
template <class ItemType>
void
UnsortedType<ItemType>::GetNextItem(ItemTypes
current Po8++;
item info [current Pos] :
int location = 0;
bool moreToSearch (location < length);
found false;
while (moreToSearch && ! found)
{
if(item info [location])
{
else
{
found
item
true;
info [location];
location++;
moreToSearch= (location < length);
}
template <class ItemType>
void UnsortedType<ItemType>:: InsertItem(ItemType
item)
{
info [length] = item;
length++;
}
template <class ItemType>
void UnsortedType<ItemType>::DeleteItem (ItemType
item)
(
int location = 0;
while (item-info [location])
location++;
info [location]
length--;
info [length - 1];
Transcribed Image Text:In today's lab we will design and implement the List ADT where the items in the list are unsorted. template <class ItemType> void UnsortedType<ItemType>:: RetrieveItem (ItemType& item, bool found) { unsortedtype.h #ifndef UNSORTEDTYPE_H_INCLUDED #define UNSORTEDTYPE_H_INCLUDED const int MAX_ITEMS= 5; template <class ItemType> class UnsortedType { 1 } public : } UnsortedType (); void MakeEmpty(); bool IsFull(); int LengthIs(); void InsertItem (ItemType); void DeleteItem (ItemType); void RetrieveItem (ItemTypes, bools); }; #endif // UNSORTEDTYPE_H_INCLUDED unsortedtype.cpp void ResetList (); void GetNextItem (ItemTypes); private: #include "UnsortedType.h" template <class ItemType> UnsortedType<ItemType>:: UnsortedType() } int length; ItemType info [MAX_ITEMS]; int currentPos; template <class ItemType> void UnsortedType<ItemType>::MakeEmpty() 1 length = 0; 1 template <class ItemType> bool UnsortedType<ItemType>:: IsFull () { length = 0; current Pos = -1; item) return (length == MAX_ITEMS); template <class ItemType> int UnsortedType<ItemType>:: LengthIs () { return length; } template <class ItemType> void UnsortedType<ItemType>:: ResetList () { current Pos = -1; template <class ItemType> void UnsortedType<ItemType>::GetNextItem(ItemTypes current Po8++; item info [current Pos] : int location = 0; bool moreToSearch (location < length); found false; while (moreToSearch && ! found) { if(item info [location]) { else { found item true; info [location]; location++; moreToSearch= (location < length); } template <class ItemType> void UnsortedType<ItemType>:: InsertItem(ItemType item) { info [length] = item; length++; } template <class ItemType> void UnsortedType<ItemType>::DeleteItem (ItemType item) ( int location = 0; while (item-info [location]) location++; info [location] length--; info [length - 1];
Generate the driver file (main.cpp) where you perform the following tasks. Note that you cannot make any change to
the header file or the source file.
Operation to Be Tested and Description of Action
Create a list of integers
Insert four items
Print the list
Print the length of the list
Insert one item
Print the list
.
●
.
.
●
.
.
•
●
●
●
●
.
.
●
•
•
Retrieve 4 and print whether found or not
Retrieve 5 and print whether found or not
Retrieve 9 and print whether found or not
Retrieve 10 and print whether found or not
Print if the list is full or not
Delete 5
Print if the list is full or not
Delete 1
Print the list
Delete 6
Print the list
Write a class student Info that represents a student
record. It must have variables to store the student ID,
student's name and student's CGPA. It also must have a
function to print all the values. You will also need to
overload a few operators.
Create a list of objects of class studentInfo. 4
Insert 5 student records
Delete the record with ID 15467
Retrieve the record with ID 13569 and print whether
found or not along with the entire record
Print the list
Input Values
5769
1
15234 Jon 2.6
13732 Tyrion 3.9
13569 Sandor 1.2
15467 Ramsey 2 3.1
16285 Arya 3.1
7
Expected Output
5769
4
57691
Item is not found
Item is found
Item is found
Item is not found
List is full
List is not full
769
79.
Item is found
13569, Sandor, 1.2
15234, Jon, 2..6
13732, Tyrion, 3.9
13569, Sandor, 1.2
16285, Arya, 3.1
Transcribed Image Text:Generate the driver file (main.cpp) where you perform the following tasks. Note that you cannot make any change to the header file or the source file. Operation to Be Tested and Description of Action Create a list of integers Insert four items Print the list Print the length of the list Insert one item Print the list . ● . . ● . . • ● ● ● ● . . ● • • Retrieve 4 and print whether found or not Retrieve 5 and print whether found or not Retrieve 9 and print whether found or not Retrieve 10 and print whether found or not Print if the list is full or not Delete 5 Print if the list is full or not Delete 1 Print the list Delete 6 Print the list Write a class student Info that represents a student record. It must have variables to store the student ID, student's name and student's CGPA. It also must have a function to print all the values. You will also need to overload a few operators. Create a list of objects of class studentInfo. 4 Insert 5 student records Delete the record with ID 15467 Retrieve the record with ID 13569 and print whether found or not along with the entire record Print the list Input Values 5769 1 15234 Jon 2.6 13732 Tyrion 3.9 13569 Sandor 1.2 15467 Ramsey 2 3.1 16285 Arya 3.1 7 Expected Output 5769 4 57691 Item is not found Item is found Item is found Item is not found List is full List is not full 769 79. Item is found 13569, Sandor, 1.2 15234, Jon, 2..6 13732, Tyrion, 3.9 13569, Sandor, 1.2 16285, Arya, 3.1
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY