help with java assignment


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: help with java assignment

  1. #1
    Bumi, Windu Guest

    help with java assignment


    I must write a program which receives 2 integer inputs, x and y, and computes
    x to the y power (without using the Math.pow method).
    I must write code which perform this computation.

    I must say I am desperately needing help.


  2. #2
    Paul Clapham Guest

    Re: help with java assignment

    What part of it do you need help with? What have you done so far?

    "Bumi, Windu " <wbumi@rcnchicago.com> wrote in message
    news:3bcc78b3$1@news.devx.com...
    >
    > I must write a program which receives 2 integer inputs, x and y, and

    computes
    > x to the y power (without using the Math.pow method).
    > I must write code which perform this computation.
    >
    > I must say I am desperately needing help.
    >




  3. #3
    mandye Guest

    Re: help with java assignment



    public class temp{
    private static long s(int a,int b){
    for(int i=1;i<b;i++)
    a*=a;
    return a;
    }
    public static void main(String[] args){
    long temp=s(10,2);
    System.out.println("s(10,2)="+temp);
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center