Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Procedures [7/13]

This program defines two versions of function-procedure multiCircle. The first version has 2 parameters, and the second version has an additional parameter cl of type color. This effectively makes the parameter cl optional.

In this example, two different function-procedures share the same name multiCircle. When two differerent functions share the same name, it is said that the name has been overloaded.

In this case, we can unify the signature of both functions into one. That signature would be:

  • void multiCircle(
    • point2D center,
    • num radius,
    • /color cl
    • )

In this signature, the forward slash (/) indicates that the parameter cl is optional.

Loading...