Confidential Teaching Materials:
Quiz 1 Grading Criteria, Page 3 of 5
Procedure Header: (8 pts)
2 pts for being a procedure (pro)
1 pt for data parameter (rec)
1 pt for data parameter of being proper type ( rec)
1 pt for being an in param (inp)
1 pt for pointer parameter (ptr)
1 pt for ptr being of appropriate type ListPtr (ptr)
1 pt for ptr being being an in/out param (inp)
Body: (22 pts)
2 pts for having a temp pointer ( ptr)
nil case (6pts)
2 pts for checking for nil (wrt, log)
1 pts for creating a new node ( nwp)
2 pts for correctly filling it with data (rec, log)
1 pt for setting head^.Next to nil (ptr)
insertion case (8pts)
2 pts for detecting correct place for insertion ( wrt,log)
1 pt for accessing data.Name correctly (rec)
1 pt for accessing head^.Data.Name correctly (ptr, rec)
1 pt for creating a new node ( nwp)
1 pt for correctly filling it with data ( rec)
1 pt for assigning temp^.Next <- head (ptr, log)
1 pt for assigning head <- temp ( ptr, log)
recursion (6pts)
2 pts for recursing at the right time (wrt, log)
1 pt for attempting the recursion ( rsr)
1 pt for data parameter (rsr)
2 pts for head^.Next parameter (rsr)
[p4] 40 points
A new scholarship has been created. Students with a GPA of 3.5 or higher are eligible to apply. We need to make
a list of all students who are eligible. Write a RECURSIVE module that:
• expects to be passed the head of a list that is maintained in alphabetical order by name (one you created in p2).
• returns a pointer to the head of a NEW list that contains a list of students with GPA better than or equal to 3.5.
(Hint: no need to sort the new list!)
LINES=51
[c4] 40 points
Solution model 1: