Search:

Type: Posts; User: Delstateprogramer

Search: Search took 0.23 seconds.

  1. Replies
    3
    Views
    2,564

    Re: Trouble with law of Cosine program

    thanks and how would I be sure that its returning degrees(I dont want Radians)?and what of the regular cos(double x) that one is giving me an error too?
  2. Replies
    3
    Views
    2,564

    Trouble with law of Cosine program

    Hello all you Java programmers out there. I have a tiny problem. The code is not allowing me to use the cos(double x) and acos(double x) methods even though I imported the math class. So....Whats...
  3. Replies
    11
    Views
    1,582

    Re: AddEmUp

    it worked thx alot man
  4. Replies
    11
    Views
    1,582

    Re: AddEmUp

    ok thx ill try that
  5. Replies
    11
    Views
    1,582

    Re: AddEmUp

    hey i tried it.. maybe i invoked the method at the wrong point. there is an infinite recursion some where. Heres the code

    public static void main(String[] args) {
    ...
  6. Replies
    11
    Views
    1,582

    AddEmUp

    Alright guys and girls got a new one I need a lil help with. Im currently writing a program that is supposed to add the elements in a array and return the sum. Its supposed to be a recursive method...
  7. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    lol the code works and that all that matters
  8. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    Thank you for your help everyone i figured the problem out heres the code i used


    public static int addDigits(int number)
    {
    if(number<10)
    {
    sum=number+sum;
    }
    else
  9. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    Tried this code and it didnt work


    if(number<10)
    {
    return number;
    }
    else
    {
    return (number%10)+((addDigits(number/10)));
  10. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    Ok thx ill try that out
  11. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    how do i save the prior digits to add them up at the end becuz here they keep changing and are not saved so they cant be added at the end
  12. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    The user should be able to enter any integer and the program should output the sum of the digits in the integer.
  13. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    I didnt intend for it to be a number 1 through 99. It would not matter what the user put in. and yes it would add the digits in an integer. Heres an example.

    If the user entered the integer 223...
  14. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    thats the new code but yea its a logical error in there somewhere
  15. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    public class AddEmUp {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    System.out.println("Enter an integer:");
    ...
  16. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    yes thats exactly it and I fear i thought i got it but i didnt still need some help lol
  17. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    Nvm all i got it
  18. Replies
    21
    Views
    1,721

    Re: New Recursion problem need lil help

    Changed my mind not gonna use an array, ive decided to do something like this but its not really working and i kno why but i dnt know how to change itm


    while(number>10)
    {
    digit=number%10;
    sum...
  19. Replies
    21
    Views
    1,721

    New Recursion problem need lil help

    this program is supposed to add up the integers in a number entered by a user and print out the sum. i got the easy part down.


    if(number<10)
    {
    sum=number;
    }


    for the next part i was...
  20. Replies
    6
    Views
    1,808

    Re: Recursion Problem Need Help ASAP

    ...I just knew it was something simple like that....I feel dumb lol, But thanks man preciate it.
  21. Replies
    6
    Views
    1,808

    Re: Recursion Problem Need Help ASAP

    Heres the modified code


    System.out.println("Enter an integer:");
    Scanner input=new Scanner(System.in);
    int number= input.nextInt();
    ...
  22. Replies
    6
    Views
    1,808

    Re: Recursion Problem Need Help ASAP

    Hey thx.. I changed the code a bit since this post... I have decided to use the modulus operator and I still need a bit of help. And yes this problem does require recursion. Heres the problem from...
  23. Replies
    6
    Views
    1,808

    Recursion Problem Need Help ASAP

    I need help making a recursive program that computes the number of odd digits in a number. This is as far as I have gotten.



    public class ComputeOddNumbers {

    /**
    * @param args the...
  24. Replies
    1
    Views
    404

    Hello Programmers

    Hey everybody whats goin on. Im a starter java programmer and I have been doing this for a year. Im tryna learn more about programming and i came to this site cuz i need some help. Stay creative guys...
Results 1 to 24 of 25