Ive coded one corner here, please make use of the diagram in the previous post to undertstand how to do the other corners.
After this you may want to consider how to fill the shape, which is currently no possible as you are drawing with lines.
The following post should help with this.
I have a feeling this may be homework related so I’ll leave some challenges for you.
x = 50;
y = 50;
w = 200;
h = 100;
r = 10;
x2 = x+r;
y2 = y+r;
w2 = w-r*2;
h2 = h-r*2;
arc(x2+w2,y2+h2, r*2, r*2, 0, HALF_PI);