Another Question on Java programming

Discussion in 'Java' started by Topiloe, Sep 25, 2012.

  1. Topiloe

    Topiloe

    Joined:
    Sep 25, 2012
    Messages:
    2
    Likes Received:
    0
    Location:
    Montreal
    Write a program in Java that computes the trigonometric function sin(x) given by the
    series
    sin(x) = x – x3/3! + x5/5! – x7/7! + · · · .
    The program should take as input a number from the command-line, and output the sine
    value of that number.
     
    Topiloe, Sep 25, 2012
    #1
    1. Advertisements

  2. Topiloe

    John Joe

    Joined:
    Apr 25, 2017
    Messages:
    97
    Likes Received:
    14
    Location:
    Malaysia
    Use Scanner class
    Code (Text):
    Scanner input = new Scanner(System.in);
    System.out.print("Please enter x value");
    int x = input.nextInt();
     
    John Joe, Jul 5, 2018
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.