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

Java program..  Java program.. 4. Write a program that draws an equilateral triangle.

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

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!