TCES203 Assignment  4  –  Classes solved

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

This assignment tests your understanding of concepts covered in the course dealing with classes. Redo the previous homework solution to use a Class instead of a structure. Define a Student class with a full name, hobby and student id. A student id is a 5-digit integer. The class should provide the following public functions:
• A default constructor, copy constructor and an overloaded constructor that takes all three parameters. • A function to display the information. • Mutator functions that allow us to modify the contents of a student. Only name and hobby can be modified. • Accessor functions that allow us to get the individual pieces of information – id, hobby or full name.
In main function, create and populate an array of student objects dynamically. All user input must be from the main function. Use constructors to pass the information and the corresponding functions to test all the member functions. Use C++ memory allocation operators, new and the corresponding delete to release memory. Use valgrind to check for leaks. Use a header file for the definition and a corresponding .cpp file for the implementation. Submission and Grading: Submit Student.h, Student.cpp and main.cpp under the Assignments section of the course web page as one zip file with the name Student Provide comments for the functions as well as for the class definition. Make sure that every file has a header comment including the .h and the main.cpp files.