Independent Scenario: Monitoring Readings

Work on paper first. List the input, processing, output and storage; choose your variables and explain your algorithm before opening the editor. You have already studied selection, loops, arrays, totals and extrema. This task combines them in a new setting.

Requirements

A community workshop records six integer temperature readings. Values from 10 to 30 inclusive are within the desired range. Report the count outside that range, the lowest reading and the highest reading, in that order. Every reading must influence the report. Temperatures can be negative or large: do not initialise extrema with guessed boundaries.

Plan and review

Choose a loop and initialise state from actual data. On paper test readings at 9,10,30,31; then test all readings equal. Explain why the boundary comparisons are inclusive. After solving, compare your program against the requirements, not against a particular variable naming scheme.

For an exam rehearsal, allow about 30 minutes and avoid hints until you have a complete attempt. The automated tests check behaviour; they do not assign an official Cambridge mark for your written design.

AI Socratic Tutor

All-Access
Sign in or create an account. AI Tutor is an All-Access benefit.
Sign Up

Need guidance? Ask a question or use the hint below.

AI Socratic Tutor is an All-Access Benefit

Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.

You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.

Independent Scenario: Workshop readings

+30 XP

Read six integer temperatures. Output the number outside inclusive range 10..30, then the minimum, then the maximum. Select your own algorithm and identifiers.

Write a complete program. Read inputs in the stated order. Output only the requested results, one per line, without input prompts. Test with your own values before submitting.

solution.pseudo
All-Access Required

Interactive exercises for Module 2 and beyond require an active plan.

○ Both boundaries
○ All equal
○ All negative
○ Large values