Rectangle coding help

Hello,

Please format your code:
https://discourse.processing.org/faq#format-your-code

Is this a homework question or academic assignment?

You edited your last post to remove the code after it was solved:

:)