Question: PLEASE HELP ASAP. For this lab, we are going to use a pointer in a class definition. Note: The lab files ( Student.h , and

PLEASE HELP ASAP.

For this lab, we are going to use a pointer in a class definition.

Note: The lab files (Student.h, and lab6.cpp) are available on GL in the directory

After you have copied the files into your lab 6 directory, you should spend some time really looking at the Student.h file.

Use the files that you copied from the class directory as the starting skeleton for your program. It includes comments about what you are going to need to do. You should not need to modify the main function at all.

There are three parts to this lab:

Code Student.cpp. The declaration for the student class is in Student.h. You can see the sample expected output below. You need to implement the constructor, destructor, and Display(). You cannot use a vector in this lab but you can use a dynamically created array.

Write the makefile (instructions are below).

Check for memory leaks using valgrind ./lab6.cpp

Student.h FILE

#ifndef STUDENT_H

#define STUDENT_H

#include

#include

using namespace std;

class Student

{

public:

Student();

~Student();

void Display();

private:

int m_num;

float *m_ptr;

};

#endif

lab6.cpp

#include "Student.h"

#include

#include

using namespace std;

int main() {

Student s;

s.Display();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!