a) Write a method named octagonArea that prints the area of the octagon: public static void...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a) Write a method named octagonArea that prints the area of the octagon: public static void octagonArea (double side) The formula for computing the area of octagon is: Area -2(1+ v2)a², where a represents the side. b) Write a test program that reads the side of an octagon, then calls the above method to print its area. Sample run 1: Enter the side of the octagon: 1 The area of the octagon is Sample run 2: Enter the side of the octagon: 5 The area of the octagon 4.82842712474619 120.71067811865474 a) Write a method named octagonArea that prints the area of the octagon: public static void octagonArea (double side) The formula for computing the area of octagon is: Area -2(1+ v2)a², where a represents the side. b) Write a test program that reads the side of an octagon, then calls the above method to print its area. Sample run 1: Enter the side of the octagon: 1 The area of the octagon is Sample run 2: Enter the side of the octagon: 5 The area of the octagon 4.82842712474619 120.71067811865474
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class octagon public static void octagonAreadou... View the full answer
Related Book For
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi
Posted Date:
Students also viewed these operating system questions
-
Write a class named Octagon that extends GeometricObject and implements the Comparable and Cloneable interfaces. Assume that all eight sides of the octagon are of equal size. The area can be computed...
-
Instructions DebugOne1.java 1 public class DebugOne1 2 { The files provided in the code editor to the /* This program displays a greeting public void main(String[] args) right contain syntax and/or...
-
Formula 8.1 provides a method for computing the sample size required to obtain a confidence interval with a specified confidence level and margin of error. The number resulting from the formula...
-
The measured and corrected cylinder pressures around IVC (210CA) are given in the table. Find out the reference pressure ppeg (the manifold air pressure) at IVC, using 5 point half-width (n=10) for...
-
Suppose that, among a certain group of students, SAT scores have a mean value of 1026 and a standard deviation of 209. Let X denote a randomly chosen student's score. What is E(X2)?
-
Which of the following measures provides an indication of how efficient a company is in employing its assets? a. Current ratio. c. Debt to assets ratio. b. Profit margin. d. Asset turnover.
-
Based upon the following data for the reactors, compressors/expanders, and distillation columns of a plant to produce 1,500 metric ton/day of methanol with an operating factor of 0.95 , estimate by...
-
Open the Emoji Solution.sln file contained in the VB2017\Chap01\Emoji Solution folder. If necessary, open the designer window. The interface contains one label control and one button. You can use a...
-
Charge q 1 = 7 nC is located at the coordinate system origin, while charge q 2 = 0 . 5 5 nC is located at ( a , 0 ) , where a = 0 . 7 5 m . The point P has coordinates ( a , b ) , where b = 0 . 2 5 m...
-
James Garage Ltd is a high end tire and rim sales company with installation and repair facilities. The following information can be obtained from the company's financial statements. James Garage Ltd...
-
Kappa Ltd is planning the acquisition of Omega Ltd (a firm in a different industry) at a projected cost of $4,650,000. The revenue to be generated by this acquisition in the first year is expected...
-
Figure 5 shows various types of multiplexing hierarchy. 40 GB OC-768 (i) (ii) (iii) X4 10 GB OC-192 X4 2.5 GB OC-48 622 MB OC-12 155 MB OC-3 52 MB OC-1 X4 STS-12 X4 STS-3 STS-1 SPE-3 X3 SPE E4 DS-3...
-
Explain your approach for working with the new immigrant as a social worker. Consider how you might adapt the cultural formulation interview for the particular Address what you would do if the client...
-
How does the cultivation of empathic intelligence contribute to fostering deeper connections and understanding between individuals within diverse cultural contexts? Explain
-
When adequate technology is introduced then it helps in increasing quantity and quality of resources and hence increases the potential of an economy and helps Efficient frontier to bulge inwards as...
-
What are the potential pitfalls of empathy fatigue and emotional burnout among healthcare professionals and first responders, and how can strategies such as self-compassion and boundary-setting...
-
Consider the following information: Probability of State of Rate of Return if State State of Economy Recession Normal Boom Economy Occurs .11 -.04 .55 .13 .34 .34 Calculate the expected return.
-
Consider the advantages and disadvantages of extending property rights so that everyone would have the right to prevent people imposing any costs on them whatsoever (or charging them to do so).
-
Find the value(s) of n in each of the following: (a) P(n, 2) = 90, (b) P(n, 3) = 3P(n, 2), and (c) 2P(n, 2) + 50 = P(2n, 2)
-
Let G = (V, E) be a loop-free undirected graph with chromatic polynomial P(G, ) and |V| = n. Use Theorem 11.13 to prove that P(G, ) has degree n and leading coefficient 1 (that is, the coefficient of...
-
Let f(x), g(x) Z7[x] where f(x) = 2x4 + 2x3 + 3x2 + x + 4 and g(x) = 3x3 + 5x2 + 6x + 1. Determine f(x) + g(x), f(x) - g(x), and f(x)g(x).
-
The potential problem with Yorktons approach to identifying ESG factors is the: A. promotion of uniform accounting standards. B. subjective assessment of ESG scores and rankings. C. inconsistent...
-
Strattons estimated conglomerate discount just prior to the announcement is: A. USD17 billion. B. USD0. C. USD17 billion. Elaine Lee is an analyst at an investment bank covering the energy sector....
-
The most relevant industry risk factors affecting Titian are: A. social. B. governance. C. environmental. Theresa Blass manages the Toptier Balanced Fund (the Fund) and recently hired John Yorkton, a...
Study smarter with the SolutionInn App