TCES203 Assignment  3  –  Structures 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 Structures, Arrays and Pointers. Define a student structure with a full name, hobby and student id. A student id is a 5-digit integer. The program should provide the following functions:
• A function that gets input and populates the array of students. The number of students should be passed as to the function to determine the size of dynamic allocation. Use C++ memory allocation operators, new and the corresponding delete to release memory. • A function to display the information about one student. • A function to display the information about an array of students. Use the same function name as the previous to show the concept of function overloading. • Functions that allow us to modify the contents of a student given their id. Only name and hobby can be modified.
In addition, provide a main function that tests each function thoroughly. Use dynamic memory allocation and make sure that there are no memory leaks (Use valgrind to check for leaks). Use a header file for the definition and a corresponding .cpp file for the implementation. Pass structure variables by address rather than by value and use const when the function shouldn’t modify the parameters. Do not use any global variables other than the structure definition. 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 comments should be written in your own words and not taken directly from this document. Write comments within functions to explain the flow or any obscure code. Provide comments for the prototypes as well as for the structure definition. Make sure that every file has a header comment including the .h and the main.cpp files. You should include a comment at the beginning of your program with some basic information and a description of the program, as in: // Menaka Abraham // 3/30/15 // 203 // Assignment #1 // // This program will…