Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a program in C using dynamic memory allocation and pointers. No arrays or structures Instruction: You must use pointers for this lab. No

Please write a program in C using dynamic memory allocation and pointers. No arrays or structures image text in transcribed
image text in transcribed
Instruction: You must use pointers for this lab. No arrays, no structures. For example, if you need an array of floats to hold the scores, do not use float score[15]. Rather use float *score, then use dynamic memory allocation to hold required memory. You must use memory optimally, that is if you have only 6 scores, you must point to a memory chunk of sizeof(float)*6 bytes. Similarly, to hold a name, instead of doing it with 2D char arrays, use 2D pointers (char firstName[1511201 char **firstName). Problem: Write a menu based program to maintain student records. Your program should take the following inputs: 1. Student first name (max. 20 characters) 2. Student last name, (max. 20 characters) 3. Student scores (float/double), e.g. 85.4 Your program should be able to take records of a minimum of 5 students. After taking the records you should provide 8 functionalities to the user. 1. Print records- prints records of all students 2. Add a new record -take a new record from the user for a new student. Be careful, you mayneed to allocate more memory using dynamic memory allocation. 3. Delete record(s)- to delete a record, ask for the last name of the student from the user. If there memory holding these records. are murliple students with ame last name, you must delete all f their records. You must freeup lete all of their records. You must free up the 4. Search by last name- prints record of the student with a given last name. If there are multiple students with the same last name, print records for all of them. 5. Sort by score-sort the records of students according to their scores, and then print thesorted records. 6. Sort by last name - sort the records of students according to their names alphabetically, and thern print the sorted records

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

Students also viewed these Databases questions