Need help writing this function. typedef struct StudentStruct { char LastName[MA
ID: 3625688 • Letter: N
Question
Need help writing this function.
typedef struct StudentStruct
{
char LastName[MAX_LENGTH];
char FirstName[MAX_LENGTH];
int StudentNumber; // Holds the Student's ID. This value is
// equal to the number of Student
struct StudentStruct *Next; // Pointer to the next most recently hired Student
} Student;
Student* promoteStudent(Student* Head);
// Precondition: A pointer to the front of the queue is passed in as a parameter,
// and at least one Student remains with the company.
// Postcondition: The Student with the highest seniority is removed from the Student
// roster and an appropriate statement about who was promoted is printed
// to the screen. A pointer to the new Head of the queue is returned
// to the calling function.
Explanation / Answer
Dear, Here is the functional code Student* promoteStudent(Student* Head){ Student *node; if(Head==NULL) return NULL; else {
node=Head;
Head=Head->Next; return node;
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.