So I'm learning Java and I was hoping to get a little help on how to perfect / enhance a small app I made to calculate the area of a triangle.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("What's the base?");
int base = in.nextInt();
System.out.println();
System.out.println("What's the height?");
int height = in.nextInt();
System.out.println();
int area = base * height / 2;
System.out.println("The area of the triangle is: " +area+ ".");
}
}
Mind you, I am BRAND NEW to programming in Java, or any language for that matter. If you wouldn't mind, can you explain in the utmost detail on how I can perfect this / make it an easier process?
Thanks a lot!