Program using TWO INPUT Angles with Degrees and Minutes and return the SUM of Angles

Discussion in 'Java' started by angad_aks, Feb 15, 2011.

  1. angad_aks

    angad_aks Banned

    Joined:
    Feb 15, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    import java.io.*;
    class angle1
    {
    	int deg,min;
    	angle1()
    	{
    		deg=2;
    		min=30;
    	}
    	angle1(int d,int m)
    	{
    		deg=d;
    		min=m;
    	}
    	void display()
    	{
    		System.out.print(deg+" "+min);
    		
    	}
    	int angletomin()
    	{
    		int m;
    		int d=(d*2)+m;
    		return d;
    	}
     int sumanglel(int a,int b)
    	{
    		angle1 o=new angle1();
    		int p=a.angletomin();
    		int q=b.angletomin();
    		int r=p+q;
    	}
    	int mintoangle(int m)
    	{
    		angle b=new angle();
    		b.deg=m/60;
    		b.min=m/60;
    		return b;
    		
    	}
    	public static void main(String args[])throws IOException
    	{
    		angle a=new angle(5,40);
    		angle b=new angle(6,20);
    		angle c=new angle();
    		InputStreamReader d=new InputStreamReader(System.in);
    		deg=Integer.parseInt(br.readLine());
    		min=Integer.parseInt(br.readLine());
    		a.display();
    		b.display();
    		c=a.sumangle();
    		c.display();
    		}
    }
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice