Computer Science, asked by navneetkujur1, 11 hours ago

Write a program by using a class ‘Draw’ without any data members but having only functions as per the specifications given below: class name : Draw void drawRectangle( ) : To draw (print) rectangle on screen. void drawSquare( ) : To draw (print) square on screen. Write a main class to create an object of the class ‘Draw’ and call the functions drawRectangle( ) and drawSquare( ).​

Answers

Answered by sujatanawale
0

Answer:

rectangle() is used to draw a rectangle. Coordinates of left top and right bottom corner are required to draw the rectangle. left specifies the X-coordinate of top left corner, top specifies the Y-coordinate of top left corner, right specifies the X-coordinate of right bottom corner, bottom specifies the Y-coordinate of right bottom corner.

Syntax :

rectangle(int left, int top, int right, int bottom

Explanation:

Mark brilliant when you like then

Similar questions