Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Graphics [2/15]

The given program contains an error.

It is not always possible for the automatic verifier to identify the exact problem, and in this case, the error report may not be very helpful.

Challenging exercises are an important part of the learning process. If all exercises were easy, they would not be very educational. Difficult exercises can be valuable learning experiences.

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 difficult, it is okay to look at the solution. However, make sure to try sincerely first. In this case, consider reading the hint.

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 statement.
[Run the program]

Loading...