Areas


import java.io.*;
class Areas39
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Areas a=new Areas();
System.out.println("enter the radius");
Float radius=Float.parseFloat(br.readLine());
float b=a.findarea(radius);
System.out.println("enter the side of square");
int n=Integer.parseInt(br.readLine());
int c=a.findarea(n);
System.out.println("enter the length of rectangle");
int length=Integer.parseInt(br.readLine());
System.out.println("enter breadth");
int breadth=Integer.parseInt(br.readLine());
int d=a.findarea(length, breadth);
System.out.println("area of circle"+b);
System.out.println("area of square"+c);
System.out.println("area of rectangle"+d);
}
}class Areas
{
public float findarea(float r)
{
float pi=3.14f;
float aoc=pi*r*r;
return aoc;
}
public int findarea(int s)
{
int sq=s*s;
return sq;
}
public int findarea(int l, int b)
{
int aor=l*b;
return aor;
}
}

No comments:

My Favorite Books

  • C and Data Structures by Ashok N. kamthane
  • Web Technologies by A. A. Puntambekar
  • Learn HTML and CSS with W3Schools
  • Learn JavaScript and Ajax with W3Schools
  • HTML5 Black Book: Covers Css3, Javascript,XML, XHTML, Ajax, PHP And Jquery
  • HTML5 Application Development Fundamentals: MTA Exam 98-375
  • .NET 4.0 Programming 6-In-1, Black Book
  • SQL Server 2008 R2 Black Book
  • Asp.net 4.0 Projects Covers: net 3.5 And .net 4.0 Codes, Black Book
  • UNIX Shell Programming 1 Edition by Yashavant Kanetkar
  • UNIX and Shell Programming 1 Edition by Richard F. Gilberg, Behrouz A. Forouzan
  • Computer Networks by Andrew S. Tanenbaum
  • Multiple Choice questions in computer science by Timothy J Williams