Apex Athletics wants to analyze the training runs of their sprinters. They need a program to track the running times (in seconds) of an athlete's sessions.
An operator enters the sprint times one by one. The operator enters 0 when they are finished entering data.
The algorithm must:
Here is a sample execution sequence:
Enter sprint time in seconds (0 to quit): 11.5
Enter sprint time in seconds (0 to quit): -2.5
Error: Negative times are not allowed.
Enter sprint time in seconds (0 to quit): 10.8
Enter sprint time in seconds (0 to quit): 12.3
Enter sprint time in seconds (0 to quit): 0
Write an algorithm to meet these requirements.
Use pseudocode or a programming language with which you are familiar.
50 exam-style questions on Edexcel GCSE Computer Science Constructs, covering Structural components of programs and Writing programs with control constructs. Each one has a worked solution and a mark scheme showing where the marks go.