Results 1 to 2 of 2
  1. #1
    anatel24 is offline Member
    Join Date
    Apr 2008
    Rep Power

    Default Help with debugger!!

    Hi, I'm new to Java and I have to write a method which counts the business days between two given days. I've already written it but it doesn't seem to work, and when I try the debugger it doesn't work and displays "no current thread to display", please help!!!!!

    This is the code:

    public String diasHab (int dia1, int mes1, int agno1, int dia2,
    int mes2, int agno2)

    { int d1 = dia1;
    int m1 = mes1;
    int a1 = agno1;
    int d2 = dia2;
    int m2 = mes2;
    int a2 = agno2;
    String diasN = diasNat (d1, m1, a1, d2, m2, a2);
    int diasNa = Integer.parseInt(diasN);
    String j1 = diaSem (d1, m1, a1);
    int j = Integer.parseInt (j1);
    int [] semana = {0, 1, 2, 3, 4, 5, 6};
    int resultado = 0;
    int cuenta = 0;
    int numRest = 0;
    String resdev = "";

    if ((Validez (dia1, mes1, agno1) == true) && (Validez (dia2, mes2, agno2)
    == true))

    while (cuenta != diasNa)
    { if ((semana [j] == 0) ||(semana [j] == 6))
    {numRest = numRest + 1;
    j = j+1;
    cuenta = cuenta + 1;
    if (j == 7)
    {j = 0;}

    resultado = diasNa - numRest;
    resdev = Integer.toString(resultado);

    return resdev;

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    NewEngland, US
    Rep Power


    I'm afraid without comments or specifics of any kind, solving a program not written in the base of English is going to be difficult for a lot of members... unless someone here understands the written language and Java together(jump right in!) ? I could probably decode it based on what the code is doing... but it would definitely likely lead to more time than I'm willing to commit versus examining it had it been in English. If you get no answer, consider writing this in English, throwing in some helpful comments to give us an idea of what the method is doing and please use [ code] [ /code] to view your code easier(use the posts "preview" to verify you've used the tags correctly).

    Nevertheless, welcome to the forums! :)
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Similar Threads

  1. JSwat Java Debugger 4.2
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-19-2007, 09:14 AM

Posting Permissions

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