Results 1 to 4 of 4
  1. #1
    Mrst is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Question Pseudocode output

    How do you complete this pseudocode assuming that output and count are integer variables?

    output = 1
    FOR count = 1 to 5
    output = output * count
    ENDFOR
    PRINT output

    Please help?

  2. #2
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    256
    Rep Power
    3

    Default Re: Pseudocode output

    so you need to first say that output is an int.

    then say int output = 1;

    then look up the java For loop structure and count from 1 to 5, then say output += output * current for loop variable (you will understand this after looking at for loop structure)

    then System.out.print(output)

  3. #3
    Mrst is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Default Re: Pseudocode output

    I am completely new to all of this. Can you show me what you are trying to say? I learn better by seeing what you are saying.

  4. #4
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    256
    Rep Power
    3

    Default Re: Pseudocode output

    i can give an example of the structure, you will have to substitute variables for what you need;

    Java Code:
    int y = 1;
    
    for (int x = 0; x < 100; x++ ) { // start of for loop
    
    y += y  * x;
    
    } // END FOR LOOP
    
    System.out.println(y); //PRINT result

Similar Threads

  1. Replies: 1
    Last Post: 02-14-2013, 05:42 AM
  2. Replies: 1
    Last Post: 11-21-2011, 08:46 PM
  3. Pseudocode to java (HELP)
    By lordrowin in forum New To Java
    Replies: 1
    Last Post: 02-02-2008, 09:54 AM
  4. Is my Pseudocode correct?
    By Clemenza1983 in forum New To Java
    Replies: 0
    Last Post: 01-29-2008, 05:07 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
  •