Question: Java program.. 4. Write a program that draws an equilateral triangle. You need to read the side length of the triangle from the user using
4. Write a program that draws an equilateral triangle. You need to read the side length of the triangle from the user using JOptionPane. Use the drawLine method described in this chapter as shown below. You have to calculate the points' vertices. Hint: the Height of an equilateral triangle is sqrt(3) * side length) 0.09 (x,y) Fig. 4.17 | Java coordinate system. Units are measured in pioxels Input 3 ? Enter Sidelength: 200 OK Cancel
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
