Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Using Java for this program) I need help getting user input(JOPTIONPANE) for the number of corners of a polygon, which is for the length of

(Using Java for this program) I need help getting user input(JOPTIONPANE) for the number of corners of a polygon, which is for the length of the array I have to use, and depending on what is entered from the input, ex: if 4 is entered then the Joptionpane will ask the user to enter an number for the x, and y coordinates 4 times,(total of 8 JOPTIONPANE windows), once all of that is entered, they will be stored in the array. Then using this data, i have to calculate the sides, perimeter, and area of the polygon.

The number of sides that will need to be calculated will also depend on the length of the array. I dont know how to approach this, and need help to find the area, perimeter, and sides. I am also struggling with the display window(JOPTIONPANE) EX.

Properties of Polygon are ________________________________ Point 1 = (Depends on input for coordinates) Point 2 = (Depends on input for coordinates) Point 3 = (Depends on input for coordinates) Point 4 = (Depends on input for coordinates) (Depending on the number of corners(size of array), that will determine how many sets of points (1 2 3...)) Side 1... (Depending on the number of corners(size of array), that will determine how many sides (1 2 3...)) Perimeter = Area =

How do I display this in the JOPTIONPANE message window?

BTW, I am using classes and methods, and have the main class on the main .java file. This is for the polygon class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

Students also viewed these Databases questions

Question

Explain the role of research design in HRD evaluation

Answered: 1 week ago