Question: debug. program will use methods and functions; the program asks the user for two values ( a and b where c is the third value
debug. program will use methods and functions; the program asks the user for two values a and b where c is the third value for a right triangle to get the area and hypotenuse, need to debug the functions and methods, value for Side A Use the value for side B Thus, should be value you will receive for hypotenuse.
import java.util.Scanner; public class MNeedtoDebug public static void mainString args; runMenu; public static void runMenu Scanner in new Scanner; String keepgoing "yes"; whilekeepgoing.equalsIgnoreCaseyes displayInfo; all calls to your functionmethods should come from runProgram method only int SideA getSideAin; int SideB getSideBin; int area calAreasideAsideB; double hyptoenuse calHypotenusesideAsideB; displayValuesideA sideB, area, hypotenuse; System.out.println; System.out.printDo you want to run the program again? Enter y or n: ; keepgoing innext; System.out.println; inclose; System.out.printlnProgram has terminated!"; public static void display System.out.println; System.out.printlnYour name"; System.out.println; public static int getSideAScanner in System.out.printEnter side A of the right triangle: ; int sideA innextLine; return sideA; public static int getSideBScanner in System.out.printEnter side B of the right triangle: ; String sideB innextDoubele; return sideB; public static String calArea int a int b ; return ab; public static double calHypotenuse double a double b hypotenuse must be double in the Math.hypot function so values are received as double not integers this function has no errors return Math.hypota b; public static int displayValuessideAsideB,area,hypotenuse System.out.println; System.out.printlnSide A is sideA; System.out.printlnSide B is sideB; System.out.printlnArea is area; System.out.printlnHypotenuse is hypotenuse; System.out.println;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
