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.
float x,y,w,h,r,x1,x2,y2,w2,h2;
void setup(){
size(400,400);
x = 50;
y = 50;
w = 200;
h = 100;
r = 10;
x2 = x+r;
y2 = y+r;
w2 = w-r*2;
h2 = h-r*2;
background(0);
stroke(255);
//fill(0,50);
noFill();
line(x2,y2,x2+w2,y2);
line(x2+w2,y2,x2+w2,y2+h2);
line(x2+w2,y2+h2,x2,y2+h2);
arc(x2+w2,y2+h2, r*2, r*2, 0, HALF_PI);
line(x2,y2+h2,x2,y2);
line(x+r,y,x+w-r,y);
line(x+w,y+r,x+w,y+h-r);
line(x+w-r,y+h,x+r,y+h);
line(x,y+h-r,x,y+r);
};
void draw(){
noLoop();
};