1. Define a class Studentwhich has a constructor, a member variable, a member function, anda destructor. The member variable is an integer type pointer (e.g.int * ptr). In the constructor, use the pointermember and new to dynamically allocate an integer,and assign its value using cin. The member functions isGetSquare(), which is to return the square of theinteger memory’s value through the pointer. In thedestructor, deallocate the integer memory assigned to thepointer.
Declare a variable using Studentin main(), call member function GetSquare() to output the squarevalue.
2. Read integer numbers from keyboard and saveinto a link list, until you read a negative value. You are asked toimplement this project use object-oriented style, namely use theclass. The project should be separated into three files, linkList.hfor declaration, linkList.cpp, and useLinkList.cpp file for utilizethe class. You are asked to implement the followingfunctions:
a. Constructor: set up the list. Initially thehead should be assigned to NULL
b. Destructor: remove all nodes from list, andrelease memory
c. InsertAsFirst: insert new node at thebeginning of the list
d. RemoveFirst: remove the first node fromlist
e. IsEmpty: determin whether the list isempty
f. Print: traversal the list, and printinformation for each node
g. Search: give a number, searchfor it. If found, print “found”, otherwise, print notfound, and insert the new information as the first node.
In the useLinkList.cpp, you needto implement the following steps:
a. Keep reading numbers from input until 0comes in.
b. Print out the whole list.
c. Remove the first node.
d. Print out the whole list.
e. Search 10
f. Print out the whole list
The following specifications will be expected for each of yourprojects for this class:
1. An empty project file must be createdfirst, and then you will create new source file and headerfiles.
2. Add comments at the beginning of theprogram, and add description for each function, loop, etc.
Turn in both the hardcopy and softcopy of yoursource code, including all .cpp and .h file. Yourname, your ID number andlab number should be written on the upperright-hand corner of the top sheet of the hardcopy.