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
Get step-by-step solutions from verified subject matter experts
