Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum

Complete help forum for students preparing for icse iit aieee cbse pmt and other related exams.Stay updated about all 2011 exams.
 
HomeHome  PortalPortal  FAQFAQ  SearchSearch  RegisterRegister  MemberlistMemberlist  UsergroupsUsergroups  Log in  India NewsIndia News  
Keywords
programs MODEL CHEMISTRY english Results result timetable sample computer 10th Icse TEST time java 2008 practical SYLLABUS table 2011 PAPERS 2009 Exam board maths question class
Latest topics
» optical fibre????
Fri May 18, 2012 8:54 pm by mahnoorbloch

» physics............
Fri May 18, 2012 8:43 pm by mahnoorbloch

» magnetism...........chapter
Fri May 18, 2012 8:33 pm by mahnoorbloch

» ac generator
Fri May 18, 2012 7:46 pm by mahnoorbloch

» Great website for maths
Sun May 06, 2012 9:39 am by mahnoorbloch

» BlueJ prog
Tue Apr 24, 2012 11:53 am by arryaan

» GBTU SEE 2012 22 April
Sat Apr 21, 2012 11:17 am by shreya94

» GBTU SEE or UPTU SEE 2012 Expected cutoff marks
Sat Apr 21, 2012 11:16 am by shreya94

» GBTU SEE 2012 UPTU SEE 2012 Solutions Answer key discussion
Sat Apr 21, 2012 11:15 am by shreya94

Top posters
abhas
 
Anu..i luv icse...:)
 
G-7
 
siya
 
Candy
 
jOhNy
 
Apurva
 
WinRrule
 
ambili
 
saif
 



Search if you can't find it here

ISC XII JAVA Inheritance program to find circles area

View previous topic View next topic Go down
AuthorMessage
abhas
Active member
Active member



PostSubject: ISC XII JAVA Inheritance program to find circles area Wed Nov 25, 2009 6:30 pm

circle.java

Code:
import java.io.*;
class circle extends point
{
    private double area,radius;
    public void callength()
    {
        Double a,b,c;
        a=Math.pow(x1-x2,2);
        b=Math.pow(y1-y2,2);
        c=a+b;
        radius= Math.pow(c,.5);
       
    }     
    public void cal_area()
    {
        area=(22/7)*radius*radius;
    }
    public void print()
    {
        System.out.println(radius);
        System.out.println(area);
        System.out.println(x1+";"+y1);
        System.out.println(x2+";"+y2);
        }
    circle()throws IOException
    {super.accept();}
}
 


point.java
Code:
import java.io.*;
class point
{
    protected double x1,x2,y1,y2;
    point()
    {
        x1=0;
        x2=0;
        y1=0;
        y2=0;
        }
    public void accept()throws IOException
    {
          BufferedReader inv= new BufferedReader(new InputStreamReader(System.in));
          System.out.println("Enter values");
          x1=Double.parseDouble(inv.readLine());
          x2=Double.parseDouble(inv.readLine());
          y1=Double.parseDouble(inv.readLine());
          y2=Double.parseDouble(inv.readLine());
        }
    }
 
         


Mncir.java
Code:
import java.io.*;
class Mncir
{
public static void main(String args[])throws IOException
{
circle s=new circle();
s.callength();
s.cal_area();
s.print();
}
}
Back to top Go down
View user profile

ISC XII JAVA Inheritance program to find circles area

View previous topic View next topic Back to top
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Complete IIT AIEEE ICSE ISC PMT help forum :: ISC :: ISC 2010 [Class xii] :: Computer-