Fill in the blanks in the following code. The code is written to draw 4 rectangles of heights 20, 30, 40, 50 respectively and widths 20, 15, 10, 5 respectively. The centres of these rectangles are at (1,2)
initCanvas();
double x=20;
double y=20;
repeat(4){
Rectangle r( BLANK-P , BLANK-Q , x, y);
r.imprint();
x = x + BLANK-R ;
y = y + BLANK-S ;
initCanvas();
double x = 20;
double y = 20;
repeat(4){
Rectangle r( P + 1 - P , Q + 2 - Q , x, y);
r.imprint();
x = x + R + 10 - R;
y = y + S - 5 - S;
}
Comments
Leave a comment