Answers

2016-05-03T19:04:07+05:30
Import java.io.*;
class Rectangle
   {
public static void main (String[]args)throws IOException
{
  double l,b,area=0.0,peri=0.0,dia=0.0;
InputStreamReader in=new InputStreamReader(System.in);
BufferedReader buf=new BufferedReader(in);
System.out.println ("Enter the length and breadth of rectangle");
    l=Double.parseDouble(buf.readLine());
    b=Double.parseDouble(buf.readLine());
    area=l*b;
    peri=2*(l+b);
    dia=Math.sqrt(l^+b^);
System.out.println("The area of rectangle + area");
System.out.println("The perimeter of rectangle + peri");
System.out.println("The diagonal of rectangle + dia");
}
    }
  
0
Dys whats wrong in the answer.
Is there anything wrong in the answer!
2016-05-03T19:48:08+05:30
I think you shoul do something like this
First import  java.io.*;

then u should do the following

 double l,b,area=0.0,peri=0.0,dia=0.0;
InputStreamReader in=new InputStreamReader(System.in);
BufferedReader buf=new BufferedReader(in);
System.out.println ("Enter the length and breadth of rectangle");
    l=Double.parseDouble(buf.readLine());
    b=Double.parseDouble(buf.readLine());
    area=l*b;
    peri=2*(l+b);
    dia=Math.sqrt(l^+b^);
System.out.println("The area of rectangle + area");
System.out.println("The perimeter of rectangle + peri");
System.out.println("The diagonal of rectangle + dia");

NOTE: DO THE STEPS AS ABOVE OR ELSE YOUR ANSWER WILL SURELY BE INCORRECT



0
Good job! But you should specify the class name after import java.io.*