Write a Java code that asks the user to enter the radius r of a sphere,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java code that asks the user to enter the radius r of a sphere, reads it, and calculate the volume and area of the sphere as follows: Area = 4tr² 4 3r³ The output should be as follows Volume = For this question, you should use Math function for doing the "power" and "n". When printing the volume and the area values, DON'T ENTER THEM MANUALLY (otherwise marks will be deducted). Only print 2 numbers after the decimal points. Enter the radius of the sphere: 10 The area of the sphere is: 1256.64 The volume of the sphere is: 4188.79 Write a Java code that asks the user to enter the radius r of a sphere, reads it, and calculate the volume and area of the sphere as follows: Area = 4tr² 4 3r³ The output should be as follows Volume = For this question, you should use Math function for doing the "power" and "n". When printing the volume and the area values, DON'T ENTER THEM MANUALLY (otherwise marks will be deducted). Only print 2 numbers after the decimal points. Enter the radius of the sphere: 10 The area of the sphere is: 1256.64 The volume of the sphere is: 4188.79
Expert Answer:
Answer rating: 100% (QA)
It appears you are asking for a Java program that calculates the surface area and volume of a sphere ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Laura mentions that employees will come back from tea break on time because they know it will let down their fellow work mates if they don't. Imagine an employee named David frequently does not...
-
Solve: y(4) +18y"+81y = 0 y(0) = -4, y'(0) = 8, y'(0) = 42, y"(0) = -108 - Submit Question X
-
Recent interest in competitive and recreational cycling has meant that engineers have directed their skills toward the design Figure P16.32 Two frictionless masses connected to a wall by a pair of...
-
Is the vector field shown in the figure conservative? Explain.
-
A shaft, having a stiffness of \(3.75 \mathrm{MN} / \mathrm{m}\), rotates at \(3600 \mathrm{rpm}\). A rotor, having a mass of \(60 \mathrm{~kg}\) and an eccentricity of 2000 microns, is mounted on...
-
The income statement of Booker T Industries Inc. for the current year ended June 30 is as follows: Changes in the balances of selected accounts from the beginning to the end of the current year are...
-
From January 2011, the price of orange juice increased by about 80%. How would I provide two separate explanations for this price increase using shifts in supply or demand? Can you please explain...
-
Marketing Objectives . Set marketing plan objectives for Lee's business . Identify at least two S.M.A.R.T. goals (i.e., specific, measurable, achievable, realistic (and relevant to the mission), and...
-
What are your organizations key resources and capabilities? What should they be in the future? How do you build toward those resources and capabilities?
-
Construct a data file about the purchasing behavior of four customers, described below, who visit a shopping mall. Enter the purchase amounts each spent on clothes, sporting goods, books, and food....
-
Identify each of the following variables as nominal, ordinal, or neither. a. Gender (with categories female, male, nonbinary, other) b. Favorite color c. Pain as measured on the 11-point pain scale,...
-
The article Understanding the impact on climate change of convenience food: Carbon footprint of sandwiches analyzed data of 24 commercially available (i.e., ready-made) sandwiches with regard to...
-
What is your strategic focus for early growth? How do you leverage what you do really well? What are some possible peripheral growth opportunities for later in your ventures life?
-
Question 2 Mylady Limited has received a request to produce a component called Zeta. The costing department has prepared the following cost estimates relating to the component. Direct materials:...
-
The Strahler Stream Order System ranks streams based on the number of tributaries that have merged. It is a top-down system where rivers of the first order are the headwaters (aka outermost...
-
Write a program that will record the purchases made at a store. For each purchase, read from the keyboard an items name, its price, and the number bought. Compute the cost of the purchase (number...
-
Suppose you are writing a program that asks the user to give a yes-or-no response. Assume that the program reads the users response into the Stringvariableresponse. a. If response is yes or y, set...
-
Repeat the previous exercise, but find the second word in the string. Previous exercise Write some Java statements that use the String methods indexOf and substring to find the first word in a...
-
Use the Chart screen (Chart ) to generate historical prices of a selected stock and its call and put options with different expirations and expiration. Select a period in which the options were...
-
Use the Chart screen (Chart ) to generate historical prices for the S\&P 500 spot, and call and put options on the index with different expirations and expiration. Select a period in which the...
-
Suppose just prior to going ex-dividend, XYZ stock is trading at \(\$ 65\) and is expected to go ex-dividend with a dividend expected to be worth \(\$2.50\) on the ex-dividend date. What advice would...
Study smarter with the SolutionInn App