import java.awt.*; //uses abstract library
import java.applet.Applet; //used applets
public class javaRectangle extends Applet //file name, class, and how
{ //opens class
public void paint (Graphics g) //uses graphics
{ //open void
int length; //declarations
int width;
int height;
int volume;
length = 10;
width = 2;
height = 5;
volume=length * width * height;
g.drawString("The length is " +length, 5, 10); //displays length
g.drawString("The width is " +width, 5, 30); //width
g.drawString("The height is " +height, 5, 50); //height
g.drawString("The Volume of the cube with these dimensions is " +volume, 5, 70);
}
}

Copyrighted Material by vmyvnesd