Area of Rectangle

Run Settings
LanguageJava
Language Version
Run Command
/* *This program calcualtes the area of a rectangle *given the dimensions * */ class Main { public static void main(String[] args) { //determine the variables double length, width, areaOfRectangle; //give variables a value length=5.7; width=4.8; String unit="cm"; //calculations areaOfRectangle=length*width; //print output System.out.println ("The area of a rectangle with a length of "+length+unit+" and a width of "+width+unit+" is "+areaOfRectangle+unit+"^2."); } }
Editor Settings
Theme
Key bindings
Full width
Lines