Independent Scenario: Club Results

This is cumulative practice after arrays, loops and subroutines. Independently turn the requirements into an input/process/output/storage plan. Use a non-square table to avoid confusing rows with columns.

Requirements

Three teams each play two rounds. Input their six integer scores in team order. Report each team's total in order, then the winning team's number (1,2 or 3). If totals tie, the lower team number wins. Scores may be zero or negative.

Before coding, choose your data representation and write a test for a tie. Trace one dataset on paper. After coding, explain how the program resets each total and how the winner comparison implements the tie rule.

Paper rehearsal

Allow about 30 minutes. Keep your initial design, test plan and corrected code together. Self-review: did all six values contribute, did negative totals work, did the first team win a tie, and did each output follow the specification? Passing the automated cases is feedback, not a guarantee of full marks on a different unseen problem.

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: Club results

+30 XP

Read six scores, two for each of three teams. Output each team total, then the winning team number. In a tie choose the lowest team number.

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.

○ Different totals
○ Tie
○ Negative scores