Question: How would I return result back to the main method in my program? public void methodName(){ System .out.println(Enter in the number of doors:); Scanner getInfo

How would I return result back to the main method in my program?

public void methodName(){ System.out.println("Enter in the number of doors:"); Scanner getInfo = new Scanner(System.in); double doorArea = 0, doorWidth, doorHeight; int doors = getInfo.nextInt(); for (int i = 1; i <= doors; i++) { System.out.println("Enter door width"); doorWidth = getInfo.nextDouble(); System.out.println("Enter door height"); doorHeight = getInfo.nextDouble(); doorArea = doorArea + (doorWidth * doorHeight); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!