- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise13.java
More file actions
Latest commit
15 lines (13 loc) · 653 Bytes
/
Copy pathExercise13.java
File metadata and controls
15 lines (13 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
publicclassExercise13 {
publicstaticvoidmain(Stringarg[]) {
// Write a program that computes the area of a polygon, where the
// number of sides and the length of the side is input by the user. The
// number of sides is an integer, but the length can be a decimal number.
// The formula is:
// N times the square of the side length, divided by 4*K,
// where K is equal to tan(pi/N),
// and N is the number of sides entered by the user.
// Hint: The Math library has a function for computing tan(x), i.e. tangent.
// Add your code here, then click "run" to test it.
}
}