Due to a rush at the end of the exam, Professor could not arrange the answer sheets in the
sequence as desired. However, he mentioned the correct location of each answer sheet with it.
Now, Professor wants all the answer sheets in the desired sequence.prepare a linklist having a data, the location, and the link node to arrange the data in the in the increasing manner of the location variable.
HINT: Item ,location ,linknode
input: 5 3 ->6 2 ->4 1->2 4 NULL
output: 4 1->6 2->5 3->2 4 NULL
Write a program to read the GPA of students from users and display the details using dynamic memory allocation.
Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.
Include the following member function in the Main class
Member FunctionDescriptionvoid display(float arr[], int size)This method is used to display the student's GPA details.
In the main method, obtain input from the user in the console and call the display method to display the GPA details.
Note:
Use a new keyword to create a dynamic array to store the GPA details.
OUTPUT
Enter total number of students:
2
Enter GPA of students
7.8
6.7
Students GPA Details
Student1 : 7.8
Student2 : 6.7
For the given code your task is to write the following functions and make menu to call them in main:
1)Insert_Element_at(int X, int pos),
2)bool Delete_Element(int X)
3) void Empty_List()
class List{
public:
int item;
int pos;
List* nextNode;
List()
{
this->pos=0;
}
List(int pos)
{
this->pos=pos;
}
List(int item,int pos)
{
this->item=item;
this->pos=pos;
}
List(List &list)
{
this->item=list.item;
this->pos=list.pos;
this->nextNode=list.nextNode;
}
};
void Insert_Element(List** head, int data)
{
//code present here to do this
}