Question: (10 points) Write a program that enables the user to draw either a triangle or a rectangle by pressing the 't' or 'r' key respectively.

(10 points) Write a program that enables the user to draw either a triangle or a rectangle by pressing the 't' or 'r' key respectively. The user can specify the vertices of the polygon by clicking on the screen three times for a triangle or two times for a rectangle. The program will display the vertices of the polygon as dots on the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!