Pseudocode, i think, doesn't have a predefined syntax. just follow two rules:
It should be plain english with common programming constructs.
It should be generic, not specific to any language.
Following should fit:
Step 1: Initialize an empty string. (say str)
Step 2: Construct a new 'Finch' object.
Step 3: BEGIN LOOP
Fetch 'FinchMenu' from 'Finch' object.
assign 'FinchMenu' to 'str'
IF 'FinchMenu' is "Back and forward"
Call 'RunAccelerationTest' method with 'str' as argument.
END IF
END LOOP
Answer from Azodious on Stack OverflowHello everyone! I want to learn how to read pseudocode and type up a java program using it....
public static boolean f0(int a) {
if (a == 0)
return true;
if (a == 1)
return false;
if (a < 0)
return f0(-a);
return f0(a - 2);
}for example, if I get a question like this, how can I try to understand what happens here? Not asking for solutions, I just want to know how you would try to solve it. If there are any books or resources that can help me , please comment them below..thank you!
What is an example of a pseudocode?
How do you use pseudocode?
How do you write pseudocode for beginners?
Videos
Pseudocode, i think, doesn't have a predefined syntax. just follow two rules:
It should be plain english with common programming constructs.
It should be generic, not specific to any language.
Following should fit:
Step 1: Initialize an empty string. (say str)
Step 2: Construct a new 'Finch' object.
Step 3: BEGIN LOOP
Fetch 'FinchMenu' from 'Finch' object.
assign 'FinchMenu' to 'str'
IF 'FinchMenu' is "Back and forward"
Call 'RunAccelerationTest' method with 'str' as argument.
END IF
END LOOP
Pseudo code is just a non language specific human readable walkthrough of whatever it is you are trying to do.
You could write set s to "" or even make s an empty string or anythign else that describes what it is this step is doing.