A regular polygon is an n-sided polygon in which all sides are of the same length and
Question:
A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). The formula for computing the area of a regular polygon is
Here, s is the length of a side. Write a program that prompts the user to enter the number of sides and their length of a regular polygon and displays its area. Here is a sample run:
Transcribed Image Text:
пx? Area 4 x tan Enter the number of sides: 5 Enter the side: 6.5 The area of the polygon is 74.69017017488385 -Enter -Enter
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 71% (14 reviews)
Program Plan Define the class testArea Define the manmethod Declare the variables Prompt the user to ...View the full answer
Answered By
Shashi Kumar Maurya
I completed my master's in Statistics and Computing from Banaras Hindu University in India. I have working experience as data analysis. I have good experience in programming languages like R and python.
I have also worked on my tutors' websites like Chegg, Bartleby, and Tutor.com as a Subject Matter Expert.
I have good knowledge of Statistics.
Currently, I'm working in a startup as a Subject Matter Expert. Here I'm responsible for providing the best solution to the US and UK based students. I have experienced in Solving Text Book Solutions.
0.00
0 Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write a program that prompts the user to enter the number of students and each students name and score, and finally displays the student with the highest score and the student with the second-highest...
-
Write a program that prompts the user to enter the number of students and each students name and score, and finally displays the name of the student with the highest score. Use the next() method in...
-
Write a program that prompts the user to enter the number of students, the students names, and their scores and prints student names in decreasing order of their scores. Assume the name is a string...
-
Ginter Co. holds Kolar Inc.s $10,000, 120-day, 9% note. The entry made by Ginter Co. when the note is collected, assuming no interest has been previously accrued, is: (a) Cash Notes Receivable (b)...
-
Show that the shaker sort hasO(n2) complexity measured in terms of the number of comparisons it uses.
-
What benefits have wikis brought to Shell?
-
Jane Edwards Ltd has prepared her cash flow statement under the direct method. She has the following main cash flows. a Cash from customers 125,000 Dividends paid 8,000 Cash paid to employees 18,300...
-
Fresh Tracks Baking Company is a diversified food products company with three operating divisions organized as investment centers. Condensed data taken from the records of the three divisions for the...
-
A carpenter sets aside $246,500.00 today to renovate a house in a historic neighborhood. If the housing market is good, he expects to sell the house for $407.650.00 in 200 years. However if the...
-
The following tableau for a dual maximum problem was obtained using the simplex method for optimizing a minimum problem. P Y/1 Y2 81 82 RHS 0 1 2 1 0 6 0 1 6 0 1 3 1-16 48 000 Find the pivot...
-
Write a program that generates three random points on a circle centered at (0, 0) with radius 40 and display three angles in a triangle formed by these three points, as shown in Figure 4.7a.? (a) A...
-
The area of a hexagon can be computed using the following formula (s is the length of a side): Write a program that prompts the user to enter the side of a hexagon and displays its area. Here is a...
-
Two carts of equal inertia are moving in opposite directions toward each other. Figure P4.7 represents the positions of the carts until they collide. Sketch the positions of the carts after the...
-
Pecos Pecan Pads makes pressed pecan wood covers to prevent weed growth. During July 2009, the company produced and sold 44,000 rolls and recorded the following cost data: Requirements 1. Compute the...
-
The Human Resources departments costs are allocated to the other departments based on the number of direct labor hours. The departments expected fixed costs are 400,000 and its variable costs are...
-
A lawyer allocates overhead costs based on her hours working with different clients. The lawyer expects to have \($200,000\) in overhead during the year and expects to work on clients cases 2,000...
-
When a supersonic airflow, \(M=1.8\), passes through a normal shockwave under sea level conditions, what are the values of the stagnation pressure before and after the normal shockwave?
-
Eastern University, located in central Canada, prides itself on providing faculty and staff with a competitive compensation package. One aspect of this package is a tuition benefit of \($4,000\) per...
-
The Washington Trader was a giant oil tanker owned by the plaintiff, American Trading and Production Corporation. In March 1967, the defendant, Shell International Marine, Ltd., contracted for the...
-
An item of depreciable machinery was acquired on 1 July 2009 for $120,000 by cash It is expected to have a useful life of 10 years and zero salvage value On 1 July 2012, it was decided to revalue the...
-
Develop a GUI application that displays Unicode characters, as shown in Figure 36.13. The user specifies a Unicode in the text field and presses the Enter key to display a sequence of Unicode...
-
Write a program that displays the current date and time as shown in Figure 36.14. The program enables the user to select a locale, time zone, date style, and time style from the combo boxes....
-
Write a program that displays the current date in a calendar and current time in a clock, as shown in Figure 36.15. Enable the program to run standalone. CH Exercise36_03 August 2013 Sunday Monday...
-
Your company has purchased equipment worth $40,000 and would like to compare the impact of straight-line depreciation versus accelerated depreciation (double declining method). The equipment has a...
-
You have $22,000 to invest. You want to purchase shares of Alaska Air at $43.76, Best Buy at $52.62, and Ford Motor at $9.16. How many shares of each company should you purchase so that your...
-
Q 1: (A) What are open market operations? How do these work as a method of credit control? (B): What is the likely impact of money creation by the commercial banks on national income? explain briefly...
Study smarter with the SolutionInn App