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
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
Math,
15 days ago
English,
15 days ago
World Languages,
15 days ago
Hindi,
9 months ago
Biology,
9 months ago