Results 1 to 2 of 2
  1. #1
    anthonykc1 is offline Member
    Join Date
    Feb 2014
    Posts
    1
    Rep Power
    0

    Default Trace table help

    I'm confused on how to provide a trace table with this problem.

    int i = 0; int j = 1; int n = 2;
    while (i < 10) {i++; n = n + i + j; j++; }

    My professor wants us to use iterations as a way to solve it and this was the example given:

    int i = 0; int j = 1; int n = 2;
    while (i < j) { i ++; j --; n++; }

    public static String r43a() {
    // START CODE
    String answer = "iteration1: i=" + 0 + ", j=" + 1 + ", n=" + 2 ;
    answer += "\n";
    answer += "iteration2: i=" + 1 + ", j=" + 0 + ", n=" + 3 ;
    return answer;
    // STOP CODE
    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Trace table help

    Can you give some details about your problem? For example what do you mean by "trace table"?
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Gremlins in my code, I can't seem to trace
    By LaughingSeraph in forum New To Java
    Replies: 9
    Last Post: 03-14-2013, 01:59 PM
  2. Error stack trace
    By Arnold in forum Android
    Replies: 1
    Last Post: 05-13-2010, 05:54 PM
  3. Can't trace where the error, need help
    By Hnin Hnin in forum Java Servlet
    Replies: 1
    Last Post: 03-16-2009, 03:24 PM
  4. Trace and track hp number on jsp
    By angelicsign in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 12-16-2008, 06:39 AM
  5. Stack Trace
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-10-2007, 05:29 PM

Tags for this Thread

Posting Permissions

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