Hey everybody im really bad at programming can someone proofread this code and make the necessary corrections? i tried to do it myself and it never compiled. the code is for a dialog box that calculates the volume of a cylinder, and i know there are simpler codes to do it, but this is the format my teacher wants
Heres the code:
import javax.swing.*; public class classTwo { public static void main(String[] args) { String rad, hei, vol; Scanner joe = new Scanner(System.in); System.out.println ("Hi, please enter a radius."); double rad = joe.nextLine(); System.out.println ("Enter a height."); double hei = joe.nextLine(); vol = 3.14 * rad * rad * hei; System.out.println ("The volume of your cylinder is" + vol + "."); } }
P.S. im using BlueJ, if that is relevant