Liebentritt+Java+Code

Final Project

/** AreaOfARightTraingle.java calculates the area for a right triangle. * ** @author ** John __Liebentritt__ * */


 * import ** java.util.Scanner; // This imports the Scanner class from the java.util package. //


 * public **** class ** digitsInnumber { // This names the class. //


 * public **** static **** void ** main(String[] args) { // This line defines the main method. //

System. // out // .println( "Enter the Two Measurements of the Legs of a Right Triangle" ); // This line asks the user to input the two measurements of the legs of a right triangle. //

Scanner kbd = ** new ** Scanner(System. // in // ); // Java 1.5 or later (shows variable for kbd.) // System. // out // .println( "The Hypotenuse is " + squareroot); // Gives result for the two answers for the hypotenuse of a right triangle. // } } }
 * double ** a = kbd.nextDouble; // Initializes variable named “a”. //
 * double ** square1 = a * a; // Initializes variable names “square1”. //
 * double ** b = kbd.nextDouble; // Initializes variable named “b”. //
 * double ** square2 = b * b; // Initializes the variable “square2” and equals “b * b”. //
 * double ** hypotenuse = square1 + square2; // Initializes variable named “hypotenuse”. //
 * double ** squareroot = Math.//sqrt//(hypotenuse); // Initializes variable named “square root”. //