TriangleAreaR

TriangleAreaR - S } public static void main(Stringargs) {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; i public class TriangleAreaR { public static int length; public static int height; public static double area; p public static double calculateArea(int height, int length) { area = ((double)height*(double)length)/2; return area; } public static void printArea(double area) { System.out.println("the area is "+area);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: S } public static void main(Stringargs) { Scanner scan = new Scanner(System.in); System.out.println("Enter the length "); int length =scan.nextInt(); Scanner scan1 = new Scanner(System.in); System.out.println("Enter the height"); int height =scan1.nextInt(); calculateArea(height,length); printArea(area); } }...
View Full Document

Ask a homework question - tutors are online