Question: A student can only pass a course so long as they meet the following lab attendance criteria: They missed fewer than 2 labs They were

A student can only pass a course so long as they meet the following lab
attendance criteria:
They missed fewer than 2 labs
They were never late for 3 consecutive labs
Demonstrators record a string representing a student's track record -'A' for
absent,'L' for late, 'P' for present
Write a recursive program that takes in one of these strings and outputs
whether the student should fail or not. If you can't think of how to do it
recursively then just do it in any way!
Example 1:
Input: PPALLP
Output: PASS
Explanation: The student has fewer than 2 absences and was never late for 3 or
more consecutive labs
Example 2:
Input: PPALLLPPPPPPP
Output: FAIL
Explanation: The student was late 3 for consecutive labs
 A student can only pass a course so long as they

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!