4 Replies - 4736 Views - Last Post: 08 April 2011 - 08:16 AM Rate Topic: -----

#1 cdpace  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 53
  • Joined: 24-July 10

Java pseudocode

Posted 08 April 2011 - 07:25 AM

Hi everyone,

I have an assignment where I have to write a peace of code in pseudocode. My questions are these, is and specific type of pseudocode that is used for java or the general pseudocode can be used? and one last thing I am not sure on how to display methods that should run in Threads.

I think when using pseudocode with threads it should be something like this.

IF something is true THEN

START THREAD1

//THREAD 1

WHILE TRUE
BEGIN
DO SOMETHING HERE
END

//THREAD 1 END

ELSE
START THREAD 2

//THREAD 2

LOAD DATA FROM DATABASE
DISPLAY DATA TO USER

//THREAD 2 END

END IF


Sorry I know the example doesn't make allot of sense but I am just confused on just how to structure the pseudocode when there is a method that needs to run in a thread.

thank you for your help guys.

Is This A Good Question/Topic? 0
  • +

Replies To: Java pseudocode

#2 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: Java pseudocode

Posted 08 April 2011 - 07:40 AM

It should be something like this, this are some exemples of statements,

<variable> = <expression>

IF <condition>
    DO stuff;
ELSE
    DO other stuff;

WHILE <condition>
    DO stuff;

for <variable> from <first value> to <last value> by <step>
    DO stuff with variable;

function <function name>(<arguments>)
    DO stuff with arguments;
    return something;

<function name>(<arguments>)    // Function call


Was This Post Helpful? 1
  • +
  • -

#3 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: Java pseudocode

Posted 08 April 2011 - 07:45 AM

Is that what you wanted?or I didn't quite understood the subject?
Was This Post Helpful? 0
  • +
  • -

#4 cdpace  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 53
  • Joined: 24-July 10

Re: Java pseudocode

Posted 08 April 2011 - 08:07 AM

View PostMacjohn, on 08 April 2011 - 07:45 AM, said:

Is that what you wanted?or I didn't quite understood the subject?


Hi Sorry I didn't make my self clear. How should I represent pseudo code that will run inside a thread. Because I am going to have some code which is going to run inside a thread and I was confused how i am going to write it in pseudo code.

thank you
Was This Post Helpful? 0
  • +
  • -

#5 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: Java pseudocode

Posted 08 April 2011 - 08:16 AM

you can use what I gave you in my first post..that is pseudo code
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1