Java question and code-Is my code wrong?

The radius of the well casing in inches (a typical well will have a 3 inch radius)
The depth of the well in feet (assume water will fill this entire depth, although in practice that will not be true since the static water level will generally be 50 feet or more below the ground surface)
When a button is clicked the program should output the number of gallons of water stored in the well casing to a textbox, label, or message box.

Already tried:
/*
Angel Williams
*/
import java.util.Scanner;

public class WaterWell
{
// Put the constant CUBIC_FEET_PER_GALLON here

public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int radius;
int depth;

System.out.println(“This program calculates how much water will be available in a well.”);
System.out.println(“What is the radius of the casing in inches?”);
radius = keyboard.nextInt();
System.out.println(“What is the depth of the well in feet?”);
depth = keyboard.nextInt();
System.out.println(“Enter the depth of wall in feet:”);
System.out.println(“Enter the radius of casing in inches: “);

}
}

Some conversions for your reference:

Volume of a cylinder = pi * radius2 * height
1 cubic foot = 7.48 gallons of water
12 inches = 1 foot
For example, a 3 foot well full of water with a radius of 3 inches for the casing holds about 441 gallons of water — plenty for a family of 4 and no need to install a separate holding tank.

✅ Answers

? Best Answer

  • the question wants button
    http://docs.oracle.com/javase/tutorial/u…
    may help
    – Chosen by Asker

  • Leave a Comment