Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When Using this code: import java.util.Scanner; public class Main { public stati

ID: 3917260 • Letter: W

Question

When Using this code:

import java.util.Scanner;

public class Main

{

public static double perimeterRectangle(double length, double width)

{

double perimeter; // variable declarartion

perimeter=2*(length+width); // Find perimeter of rectangle

return perimeter; // return perimeter of rectangle

}

public static void main(String [] arg)

{

Scanner keyboard=new Scanner(System.in);

double length, width,perimeter;

System.out.printf("Please enter length of rectangle:");

length=keyboard.nextDouble(); // Accept length

System.out.printf("Please enter length of rectangle:");

width=keyboard.nextDouble(); // Accept width

perimeter=perimeterRectangle(length, width); // calling function

System.out.printf("Perimeter of rectangle is %.2f ", perimeter); // print perimeter of a rectangle

}

}

Or this code :

Explanation / Answer

This happens mostly if you don't have JDK installed on your machine or the path to the JDK is not set properly. Cross check the JDK installation and the JDK path. Please share other information like OS, Java version installed etc. if you are still facing the issue.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote