Question: 2 . 1 1 . 1 : Complete the program that models inflating a spherical balloon. After having done the hand calculation and pseudocode for

2.11.1: Complete the program that models inflating a spherical balloon.
After having done the hand calculation and pseudocode for a program that models inflating a spherical balloon, now implement the task in Java. Remember, first the balloon is inflated to have a certain diameter (which is provided as an input). Then you inflate the balloon so that the diameter grows by an inch, and display the amount the volume has grown. Repeat that step: grow the diameter by another inch and show the growth of the volume.
Here is sample program output for a diameter of 10:
Increase: 173
Increase: 208
Match the formatting of the sample program run in your solution. Output values to the nearest whole number.
import java.util.Scanner;
public class Balloon
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
double diameter = in.nextDouble();
/* Your code goes here */
System.out.printf("Increase: %.0f",/* Your code goes here */);
System.out.println();
/* Your code goes here */
System.out.printf("Increase: %.0f",/* Your code goes here */);
System.out.println();
}
}
Please help! And thank you!!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!