Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Graphics [2/15]

The given program contains an error.

The error report may not be very helpful, as the automatic verifier can't always identify the exact problem.

Challenging exercises are a crucial part of learning. They provide valuable learning experiences, even if they're difficult.

Exercise:

1. Try to correct the error.

Inside an expression, a symbol / denotes division. Therefore, 20 /darkorange means “20 divided by darkorange”, which does not make sense.

If the exercise is too challenging, it's okay to look at the solution. First, try to solve it on your own, and if needed, consider reading the hint for additional guidance.

Hint

Arguments must be separated by a comma (,).

Solution

    disc(x, 200, 20, /darkorange);

[Run the program]

2. Insert the statement println "x: ", x; just above the disc procedure call, inside the loop's body, within { } .
[Run the program]

Loading...