Learn to Program with ZedLX

Free Online Programming Course for Beginners

Procedures [7/13]

This program defines two versions of 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 procedures share the same name multiCircle. When two differerent procedures or functions share the same name, it is said that the name has been overloaded.

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

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

Loading...