DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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);
    }
    }

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links