If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Procedures with return values

You might need: Calculator

Problem

Aarush is writing a program to help him calculate how much exercise he does at the gym.
The procedure calcSwimYards returns the number of yards swam for a given number of laps in a pool of a given length.
PROCEDURE calcSwimYards(poolLength, numLaps)
{
   lapLength ← poolLength * 2
   RETURN lapLength * numLaps
}
Aarush then runs this line of code:
yardsSwam ← calcSwimYards(25, 10)
What value is stored in yardsSwam?
Choose 1 answer:
🤔