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: 66% (6 reviews)
The image outlines method signatures for a class Geometry that will contain static methods to compute the volume and surface area of different geometr...View the full answer
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...
-
Nintendo Company reports the following income statement accounts for the year ended March 31, 2011. (Japanese yen in millions.) Use this information to prepare Nintendos income statement for the year...
-
Using the Internet (company's Web site, Hoover's, or other Web sites), choose two of the companies listed below to research and answer the following questions: a. What corporate strategy(ies) does...
-
Consider an experiment with four groups, with eight values in each. For the ANOVA summary table below, fill in all the missing results: Mean Degrees of Sum of Square Source Freedom Squares (Variance)...
-
One Device makes universal remote controls and expects to sell 450 units in January, 850 in February, 400 in March, 600 in April, and 650 in May. The required ending inventory is 20% of the next...
-
1 AT3: Individual Assignment BFA747 Semester 2, 2023 Data Analytics for Accounting Assignment Type: Individual assignment Weighting: 35% Due Date: Written Report is due on the 16th October (Monday:...
-
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...
-
Matt Higgins needs a few new trucks for his business. He is considering buying the trucks but is concerned that the additional debt he will need to borrow will make his liquidity and solvency ratios...
-
The following data are available for S&R company7 for its first month of operations: Direct materials Direct labor @P40/hr Job 101 Job 102 Job 103 P60,000 P90,000 P56,000 18,000 36,000 38,000...
-
1 2. Let A(x) = sin t + 1 dt, find A'(x) at x = 0, and 2 3. Evaluate the following definite integrals: 2 (a) (3x + 4x)dx 4 (b) xdx
-
A debt can be repaid with payments of $3912 today, $2436 in 2 years and $6770 in 5 years. What single payment will settle the debt 3 years from now if interest is 10.5% compounded quarterly?
-
With the PID/Freeze Frame/Snapshot data monitor function, input/output signal monitor items set in the start/stop control module can be selected and read out in real-time. Answer the following PID...
-
Which of the four global strategies (International, Multidomestic, Global-Standardization, or Transnational strategy) is 3M using? Is this the best strategy for it to use? Why or why not?
-
Reconsider Prob. 3-21. Using EES (or other) software, determine the missing properties of
-
How much more interest will be earned if $5000 is invested for 6 years at 7% compounded continuously, instead of at 7% compounded quarterly?
-
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...
-
Create a Data Table to depict the future value when you vary the interest rate and the investment amount. Use the following assumptions: Interest Rates: Investment Amounts:-10.0% $10,000.00 -8.0%...
-
Isaac earns a base salary of $1250 per month and a graduated commission of 0.4% on the first $100,000 of sales, and 0.5% on sales over $100,000. Last month, Isaac's gross salary was $2025. What were...
-
Calculate the price, including both GST and PST, that an individual will pay for a car sold for $26,995.00 in Manitoba. (Assume GST = 5% and PST = 8%) a$29,154.60 b$30,234.40 c$30,504.35 d$28,334.75...
Study smarter with the SolutionInn App