Exercise 3: A. Write static methods: public static double sphereVolume(double r) :ar public static double sphereSurface(double r) : 47r² public static double coneVolume(double r, double h): - thr2 public static double coneSurface(double r, double h) :ar(h +r) that compute the volume and surface area of a sphere with radius r, and a cone with cireular base with radius r and height h. Place them into a class "Geometry2.java". Then write a program with main class called Lab7_yourlD.java" that prompts the user for the values of r and h, calls the four methods, and prints the results.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 2PE
icon
Related questions
Topic Video
Question

write easy java programs 

Exercise 3:
A. Write static methods:
public static double sphereVolume(double r) : ur
3.
public static double sphereSurface(double r) : 4ar
public static double coneVolume(double r, double h). thr?
public static double coneSurface(double r, double h) :r(h +r)
that compute the volume and surface area of a sphere with radius r, and a cone with
circular base with radius r and height h. Place them into a class "Geometry2. java".
Then write a program with main class called " Lab7 yourlD.java" that prompts the
user for the values of r and h, ealls the four methods, and prints the results.
Transcribed Image Text:Exercise 3: A. Write static methods: public static double sphereVolume(double r) : ur 3. public static double sphereSurface(double r) : 4ar public static double coneVolume(double r, double h). thr? public static double coneSurface(double r, double h) :r(h +r) that compute the volume and surface area of a sphere with radius r, and a cone with circular base with radius r and height h. Place them into a class "Geometry2. java". Then write a program with main class called " Lab7 yourlD.java" that prompts the user for the values of r and h, ealls the four methods, and prints the results.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage