//Toby Hsieh //chapter 4, Exercise 1 //calculate volume of a box import java.awt.*; import java.applet.Applet; public class ch4ex1 extends Applet { public void paint(Graphics g) { //variable declarations int length; int width; int height; int volume; //assignments length=20; width=10; height=30; volume=length*width*height; g.drawString("Volume is "+volume, 100, 100); } }