// ParameterPassing1.java
// Method basics with parameter passing
// Calculates area of a rectangle
import java.awt.*;
import javax.swing.*;

public class ParameterPassing1 extends JApplet {
	// Applet's paint( ) method which automatically comes with an applet
	public void paint( Graphics g ) {
		int length = 5;
		int width = 4;
		int area;

		area = calcArea( length, width );  // calls the method calcArea, passing two arguments
		g.drawString( "The area is equal to " + area + " .", 25, 50 );
	}

	int calcArea( int l, int w ) {
		int a;
		a = l * w;
		return a;
	}
}