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: 69% (13 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.
-
Rank each set of substances in order of increasing standard molar entropy (S). Explain your reasoning. a. 1(g); F(g); Br2(g); Cl(g) b. HO(g); HO(g); HS(g) c. C(s, graphite); C(s, diamond); C(s,...
-
Refer to the information in Exercise 22-12. Assume that each of the companys divisions has a required rate of return of 7%. Compute residual income for each division. Data From Exercise 22-12 A food...
-
You want to park your bicycle in a bicycle parking area where bike racks are aligned in a row. There are already N bikes parked there (each bike is attached to exactly one rack, but a rack can have...
-
Part A The device shown in (Figure 1) is designed to exert a large force on the stationary object at the left. The jack exerts a 225-lb upward force at B. As a result, the link BC exerts a force on...
-
A local drama company proposes a new neighborhood theater in San Francisco. Before approving the building permit, the city planner completes a study of the theaters impact on the surrounding...
-
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...
-
If a company recorded accrued salaries expense of $500 at the end of its fiscal year, what reversing entry could be made? When would it be made?
-
A semiconductor is illuminated by light at 850 nm with 500 W/m2 at a right angle to the semiconductor surface. The refractive index and the absorption coefficient at 850 nm of this semiconductor are...
-
Assume that you have complete monetary and fiscal control of a country (in the face of a global pandemic) that has low inflation, high unemployment, low interest rates and a well-educated workforce....
-
What strategies can leaders employ to mitigate resistance to change and facilitate organizational transformation in the face of entrenched norms and paradigms?
-
On January 1st, Nike Company began to show serious interest in Reebok Company. Nike was trading at $52/share with a Beta of 1.02 and Reebok stock was trading at $28/share with a Beta of .93. The S&P...
-
The following situation can be modeled by a linear function. Write an equation for the linear function and use it to answer the given question. Be sure you clearly identify the independent and...
-
Bancroft Corporation has an internal audit department operating out of head office. Various types of audit assignments are performed by the department for the eight divisions of the company. 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...
-
Regarding the following structure answer the following questions: N 1) What is the sar? wwww olaparib (lynparza) 2)What is the quantitive estimation (principle of assay)?
-
7. Determine the Q-values of the following reaction: N+13N P+13C (Given: Rest-mass of 13N = 13.005739 u; rest-mass of 13C = 13.003355 u.) (3 marks)
-
Consider the following description for the element iron, Fe Ph Iron is a silver-white malleable ductile magnetic heavy metallic element that readily rusts in moist air to give a hydrated iron oxide....
Study smarter with the SolutionInn App