讲解:Linked List、C/C++、C/C++、Memory ManagementR|Databa

Assignment #4 - Memory Management in C:Implementation of a Linked ListAssignment Description: In this assignment, you will build a program that dynamically manages memory on the heap. Specifically, you will read student information from a file, populate each student as a record in a linked list, and clean up heap memory before terminating.Learning Objectives: This assignment connects to the following course goals:●Course Goal #5: Improve problem-solving and programming competency by building ever complex programs, specifically through analyzing, designing, implementing, testing and debugging C programs using various data types, loops, branches, arrays, and structs.●Course Goal #6: Write programs that manage memory using dynamic memory allocation functions and variables that contain a memory address (pointers). Apply these skills to allocate memory at run-time, and to (a) increase performance by passing addresses to functions instead of copying data, and (b) return more than one value from a function. Starter Code: The following files are provided for you in this tarball●students.h : Defines a student structure and function prototypes●students.c : Functions are defined in this file, but not implemented ●test.data : Contains some sample test data●Makefile : For compiling the programYOUR TASK is to implement the following functions (found in student.h header file): ●Student *buildStudentList()○Creates the entire linked list from the file. Should call readNext and push functions. Return is the head of the linked list●Student *makeStudent(char name[16], int age, double gpa);○Creates a student structure on the heap based on input parameters●Student *readNext();○Reads the next line from standard input and creates a student structure on the heap●void push(Student *student);○Pushes a new student node to the head of the linked list●void insert(Student *list, Student *s, int position);○Inserts a new student node in a specific position in the linked list●DisplayAll()○Displays the entire contents of the linked list●CleanUp()○Frees all memory that remains on the heap before the program terminatesBe Careful! The purpose of this assignment is to make sure you know how to dynamically manage memory and use pointers appropriately. Therefore….●Do not edit the main method (except for testing)●Do not change the function prototypes to get your code to work. ●Do not create any new global variablesTest Cases: If you implemented your assignment correctly, you should get Linked List作业代写、代做C/C++课程设计作业、代写C/C++实验作业、代做Memory Managementhe following results. Make sure that you are not violating the conditions above when testing your assignment. We will be checking your code and ensure that it is following those rules when grading.Submission Details:●Double check that your code works before submitting. You will only be a submit your code on blackboard once●Store the students.c, students.h, test.data, and Makefile files in a single tarball named yourNetID_hw4.tar (your netID should be in the following format: ab123123)Grading Rubric:Component WeightProperly Submitted: All the submission instructions (documented above) were followed properly 10 pointsCommenting & Programming Organization: Code is well organized and properly commented. Your code should be easy to read and follow. It should not be overly complicated / convoluted. 10 pointsFunctionality - buildStudentList subroutine: Creates the entire linked list. 20 pointsFunctionality - makeStudent subroutine: Successfully able to create a student structure based on input values 10 pointsFunctionality - readNext subroutine: Successfully reads a line from standard input and creates a student structure on the heap 10 pointsFunctionality - push subroutine: Successfully inserts a student structure at the head of the linked list 10 pointsFunctionality - insert subroutine: Inserts a student node in a specific position within the linked list 10 pointsFunctionality - DisplayAll subroutine: Dumps the entire contents of the linked list to the screen (standard output) 10 pointsFunctionality - CleanUp subroutine: Frees all memory that remains on the heap before the program terminates. Full points are only allocated if no memory leaks have occured. 10 points*NOTE: Your code must compile to receive a grade. Code that does not compile will receive a grade of a zero.WARNING! All student submissions will be scanned for similarity. You may help each other, but sharing code is considered cheating. Additional details are below. Ask questions, if you are confused. ●Permissible Collaboration: (1) Working together to understand the homework, (2) Helping a fellow student with a bug, (3) Working together to design a solution (for example: flowchart diagram and/or pseudo-code)Cheating / Academic Dishonesty: (1) Sharing your code with another student, (2) Copying code segments from another student, (3) Having significantly similar code as another student, and (4) Students that have portions of their code similar to online sites such as Chegg or StackOverflow will be reported for academic dishonesty!转自:http://ass.3daixie.com/2018120813266693.html

你可能感兴趣的:(讲解:Linked List、C/C++、C/C++、Memory ManagementR|Databa)