Computer Science, asked by Aditya22795, 7 months ago

Us ing the switch statement, w rite a menu driven . program in java to accept of the length and breadth of a rectangle. Calculate and display the area, perimeter rectangle​

Answers

Answered by Dilip135
0

Answer:

class AreaOfRectangle

{

public static void main(String args[])

{

Scanner s= new Scanner(System.in);

System.out.println("Enter the length:");

double l= s.nextDouble();

System.out.println("Enter the breadth:");

double b= s.nextDouble();

double area=l*b;

System.out.println("Area of Rectangle is: " + area);

}

}

Answered by Rituraj04
0

Answer:

import java.util.Scanner;

class AreaOfRectangle {

  public static void main (String[] args)

  {

   Scanner scanner = new Scanner(System.in);

   System.out.println("Enter the length of Rectangle:");

   double length = scanner.nextDouble();

   System.out.println("Enter the width of Rectangle:");

   double width = scanner.nextDouble();

   //Area = length*width;

   double area = length*width;

   System.out.println("Area of Rectangle is:"+area);

  }

}

Explanation:

Similar questions