Results 1 to 11 of 11
Like Tree4Likes
  • 2 Post By doWhile
  • 2 Post By Junky

Thread: Write a program to compute tan (a+b) tan (a-b)

  1. #1
    bestlita is offline Member
    Join Date
    Jul 2011
    Posts
    6
    Rep Power
    0

    Default Write a program to compute tan (a+b) tan (a-b)

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package excerise;

    /**
    *
    * @author HARRISON
    *
    */
    import java.util.Scanner;
    import java.lang.Math;
    public class Excercise {
    // Display Excercise in the output window
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    // TODO code application logic here
    // create Scanner for input from command
    double a, b;
    double x;
    double x2;
    System.out.println("tangent in sides of tan a + b");
    a=5;
    b=10;
    x= Math.tan((a + b) /(1-a * b));
    System.out.println("tangent x = " + x);
    //mathtan(x) -Tangent of x
    // x2 is a double value
    Scanner input = new Scanner (System.in);
    // Obtain user input
    //using tangent b
    System.out.println("tangent in sides of tan a - b");
    b=2;
    x= Math.tan((a - b) / (1 + a * b));
    System.out.println("tangent x = " + x);
    System.out.print("The value for tan(a+b) =(tan(a)+tan(b))/(1-tan(a)*tan(b))");
    x=input.nextDouble();
    System.out.println("The value for tan(a-b)= (tan(a) + tan(b))/(1 + tan(a)*tan(b))");
    x2= input.nextDouble();
    //end of method main
    // end of class tan (a + b) and tan (a-b)

    }
    }



    ( KINDLY USE THE ABOVE CODE AND RUN IT ON GUI MODE) THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!
    Last edited by bestlita; 07-07-2011 at 01:51 AM.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    And what is your question/problem?
    qwerty53 and bestlita like this.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    A good rule of thumb is to put as much effort into writing your question here as you wish someone to put into trying to answer it. Just dumping code into the forum doesn't really help us to know how to help you does it?

  4. #4
    htuy is offline Member
    Join Date
    Jul 2011
    Posts
    5
    Rep Power
    0

    Default

    There is no such thing as "GUI mode" It is a lot of work to develop a GUI for an application. That said, there are lots of programs to help you, such as NetBeans IDE. Look up java swing on google, and you may find some help.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    ( KINDLY USE THE ABOVE CODE AND RUN IT ON GUI MODE) THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!
    DONE!!!!!!!!!!!!!!!!!!!!!!!!!! WHAT DID I WIN?????????????????????????

    Recommended reading: How to ask questions the smart way

    db

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default

    Is this a continuation from this thread? Check this question

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    bestlita is offline Member
    Join Date
    Jul 2011
    Posts
    6
    Rep Power
    0

    Default Display the below code into a gui form or user friendly in java

    A program to compute tan (a +b) (tan (a-b)
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package excerise;

    /**
    *
    * @author ITALIAN
    *
    */
    import java.util.Scanner;
    import java.lang.Math;
    public class Excercise {
    // Display Excercise in the output window
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    // TODO code application logic here
    // create Scanner for input from command
    double a, b;
    double x;
    double x2;
    System.out.println("tangent in sides of tan a + b");
    a=5;
    b=10;
    x= Math.tan((a + b) /(1-a * b));
    System.out.println("tangent x = " + x);
    //mathtan(x) -Tangent of x
    // x2 is a double value
    Scanner input = new Scanner (System.in);
    // Obtain user input
    //using tangent b
    System.out.println("tangent in sides of tan a - b");
    b=2;
    x= Math.tan((a - b) / (1 + a * b));
    System.out.println("tangent x = " + x);
    System.out.print("The value for tan(a+b) =(tan(a)+tan(b))/(1-tan(a)*tan(b))");
    x=input.nextDouble();
    System.out.println("The value for tan(a-b)= (tan(a) + tan(b))/(1 + tan(a)*tan(b))");
    x2= input.nextDouble();
    //end of method main
    // end of class tan (a + b) and tan (a-b)

    }
    }

  8. #8
    bestlita is offline Member
    Join Date
    Jul 2011
    Posts
    6
    Rep Power
    0

    Default Kindly write code below in java swing; joptionpane

    Please run the program using Swing command in java. Thanks


    A program to compute tan (a +b) (tan (a-b)
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package excerise;

    /**
    *
    * @author ITALIAN
    *
    */
    import java.util.Scanner;
    import java.lang.Math;
    public class Excercise {
    // Display Excercise in the output window
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    // TODO code application logic here
    // create Scanner for input from command
    double a, b;
    double x;
    double x2;
    System.out.println("tangent in sides of tan a + b");
    a=5;
    b=10;
    x= Math.tan((a + b) /(1-a * b));
    System.out.println("tangent x = " + x);
    //mathtan(x) -Tangent of x
    // x2 is a double value
    Scanner input = new Scanner (System.in);
    // Obtain user input
    //using tangent b
    System.out.println("tangent in sides of tan a - b");
    b=2;
    x= Math.tan((a - b) / (1 + a * b));
    System.out.println("tangent x = " + x);
    System.out.print("The value for tan(a+b) =(tan(a)+tan(b))/(1-tan(a)*tan(b))");
    x=input.nextDouble();
    System.out.println("The value for tan(a-b)= (tan(a) + tan(b))/(1 + tan(a)*tan(b))");
    x2= input.nextDouble();
    //end of method main
    // end of class tan (a + b) and tan (a-b)

    }
    }
    Last edited by bestlita; 07-08-2011 at 06:22 AM.

  9. #9
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,782
    Rep Power
    7

    Default

    Quote Originally Posted by bestlita View Post
    Please run the program using Swing command in java. Thanks
    ]WHY SHOULD WE? WE ARE NOT YOUR FRIGGIN SLAVES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    As others tried to bring to your attention you have to ask a question.
    sunde887 and JosAH like this.

  10. #10
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Use code tags. It's really not that difficult and it makes your code much more readable.

    Why should we have to compile and run your code to find out your problem? You are here looking for help, don't expect people to bend over backwards for you. You will do the majority of the work here.

  11. #11
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. how can write program for gui
    By pothireddy in forum Advanced Java
    Replies: 9
    Last Post: 11-04-2010, 06:17 AM
  2. Replies: 5
    Last Post: 06-08-2010, 04:22 PM
  3. Using Scanner to compute an average of the values
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •