Posts

Showing posts from March, 2024

calculate the area of a rectangle using the next double

  A program that can calculate the area of a rectangle using the nextDouble  import java.util.*; public class Rectangle {     public static void main(String[] args){       Scanner scan = new Scanner(System.in);         double length,width; System.out.println("please enter the value of the length"); length = scan.nextDouble();         System.out.println("please enter the value of width");         width = scan.nextDouble();         double area = length*width;         System.out.println("the area of the rectangle is ="+" "+area);     }      }