Write static methods: that compute the volume and surface area of a cube with height h, sphere
Question:
Write static methods:
that compute the volume and surface area of a cube with height h, sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with circular base with radius r and height h. Place them into a class Geom etry. Then write a program that prompts the user for the values of r and h, calls the six methods, and prints the results.
••
Transcribed Image Text:
public static double cubeVolume (double h) public static double cubeSurface (double h) public static double sphereVolume (double r) public static double sphereSurface (double r) public static double cylinderVolume (double r, double h) public static double cylinderSurface (double r, double h) public static double coneVolume (double r, double h) public static double coneSurface (double r, double h)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (3 reviews)
Answered By
Muhammad Umair
I have done job as Embedded System Engineer for just four months but after it i have decided to open my own lab and to work on projects that i can launch my own product in market. I work on different softwares like Proteus, Mikroc to program Embedded Systems. My basic work is on Embedded Systems. I have skills in Autocad, Proteus, C++, C programming and i love to share these skills to other to enhance my knowledge too.
3.50+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Java Programming questions
-
Write static methods public static double sphereVolume(double r) public static double sphereSurface(double r) public static double cylinderVolume(double r, double h) public static double...
-
Solve Exercise E8.11 by implementing classes Sphere, Cylinder, and Cone. Which approach is more object-oriented? Data from Exercise E8.11 Write static methods public static double...
-
Write methods public static double sphereVolume(double r) public static double sphereSurface(double r) public static double cylinderVolume(double r, double h) public static double...
-
Discuss the factors that impact on recruitment and selection in organisations. 1.regulatory and legislative factors 2.organisational factors 3.labour market factors.
-
Using EES (or other) software, determine the effects of pressure ratio, maximum cycle temperature, and compressor and turbine efficiencies on the net work output per unit mass and the thermal...
-
What do you find most unclear/confusing about Kanes argument in the reading. If nothing, note what you find most interesting. Kane discusses SFAs. Provide your own example and explain what you would...
-
An investment is guaranteed to have a unique value of IRR if which of the following is true? a. Alternating positive and negative cash flows b. An initial negative cash flow followed by all positive...
-
Piscataway Plastics Company manufactures a highly specialized plastic that is used extensively in the automobile industry. The following data have been compiled for the month of June. Conversion...
-
13. An analyst is valuing Red Inc. common stock using the dividend discount model. The company plans to start paying dividends with its first dividend of $3.25 per share occurring next year. To...
-
Presented below are annual coupon rates, yield rates, and expected duration for a series of debentures. Calculate the issuance price for each debenture assuming that the face value of each bond is...
-
Modify the application of How To 7.1 so that it can deal with multiple students. First, ask the user for all student names. Then read in the scores for all quizzes, prompting for the score of each...
-
Reimplement the Day class of Worked Example 2.1 to be mutable. Change the methods addDays, nextDay, and previousDay to mutate the implicit parameter and to return void. Also change the demonstration...
-
Jill Karnick abandoned her attempt to complete an inventory roll-forward because of the considerable amount of work the procedure involved. Do you believe she made an appropriate decision given the...
-
As the only landscape architect on her project team, Serena is used to making decisions about drainage sites and wetland mitigation as she and her team design an expansion of the city park. During...
-
what is the difference for house price equation for a country with mortage interest and municpal taxes that are both tax-deductiable vs. a country that mortgage interest and municipal taxes are not...
-
Analyze the decision-making process NASA used. What biases and "traps" did the team members fall into? How did NASA handle conflict and divergent opinions? How did this affect the decision-making...
-
The basic efficient market hypothesis theorizes that the market cannot be beaten because it incorporates all important determining information into current share prices. Therefore, stocks trade at...
-
Specify the purpose of cache memory and elaborate. 2- why in early computer machines, there was no cache memory at all?
-
Virtually everyone needs a will. Why?
-
An investor sells a European call on a share for $4. The stock price is $47 and the strike price is $50. Under what circumstances does the investor make a profit? Under what circumstances will the...
-
The following is a dump of an SCTP general header in hexadecimal format. 04320017 00000001 00000000 a. What is the source port number? b. What is the destination port number? c. What is the value of...
-
In SCTP, a packet is carrying two DATA chunks, each containing 22 bytes of user data. What is the size of each DATA chunk? What is the total size of the packet?
-
An SCTP client opens an association using an initial tag of 806, an initial TSN of 14534, and a window size of 20,000. The server responds with an initial tag of 2000, an initial TSN of 670, and a...
-
1. Solve following recurrences using Master's Method (i) T(n) 3T (n/3) + n/2 (ii) T(n) = 7 T(h/3)+n (iii) T (n) = 2T (n/2) + n log n
-
Please give as much information as possible for each answer. Thank You. At least in theory, the design of a block cipher is generally made more secure by: increasing the number of rounds used in a...
-
The OR logic gate outputs a 1 if either of the two inputs are 1, otherwise it will output a 0. For example: If the two inputs are 0 and 1 then it will output a 1 If the two inputs are both 0 then it...
Study smarter with the SolutionInn App