Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Imming I home > 2 . 7 : Floating - point ( double ) Testing with radius 5 . 5 Your value 6 9 6

Imming I home >2.7 : Floating-point (double)
Testing with radius 5.5
Your value
696.91
CHALLENGE
ACTIVITY
2.7.2: Floating-point numbers (double)
5280523482822.q32qy7
Jump to level 1
Complete the code to output "Radius is "followed by the value of hemisRadius to three digits afte line, output "Volume is " followed by the value of hemisVol to five digits after the decimal point. En
Ex: If the input is 1.100, then the output is:
Radius is 1.100
Volume is 2.78764
Note: System out.printf() can be used with "%. Xf" to output a double to x digits after the decimal p
public class Hemisphere
public static void main (String[] args){
Scanner scnr = new Scanner(
System.in);
double hemisRadius;
double hemisvol;
hemisRadius = scnr . nextDouble () ;
hemisVol =(2.03.0)* Math.PI *(hemisRadius * hemisRadius * hemisRadius)
System.out.printf("Radius is "+("%.3f?
, hemisRadius);
System.out.printf("Volume is "+("%.", hemisvol);
System.out.print();
}
83
1
2
3
Check
Next level
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions