Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C++ program that includes the following . Define the class Student in the header file Student.h #1fndef STUDENTH #define STUDENTH #include #include using
Write a C++ program that includes the following . Define the class Student in the header file Student.h #1fndef STUDENTH #define STUDENTH #include #include using namespace std; - - class Student public: // Default constructor Student(); // Creates a student with the specified id and name Student(int id, const string& name); // Returns the student name string get_name() const; // Returns the student id. int get_student_id () const; // Sets the student name void set_name(const string& name); // Sets the student id. void set_student_id(int id); // Prints the student id and name. void print_student () const; private: / student name string name; // student id int id; d; #end if Compile This lab exercise should be put under cse330/1abe1 subdirectory Sg++ -c Student.cpp $.g++ -c label.cpp $g++ Student.o lab01.o -o labe1 $ls lab01.cpp lab01.o lab01 Student.cpp $./lab01 Student.h Student.o Capture the result in a script file lab@1result. $script lab01result $./lab01 exit $ls lab01.cpp lab01.o lab01 labelresult Student.cpp Student.h Student.o Handin Student.h: the header file containing attributes and member function prototypes with comments * Student.cpp: the implementation file containing the implementation of all member functions. lab01.cpp: the client test file containing main() funcion. lab01result: the script file which captures the result
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started