Difference between revisions of "CSharp to Pseudo Code"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "==Assigning a value== '←' is to assign a value to a variable, essentially just like '=' in C#. ==While Loop== The command words used in the exam questions is: WHILE (Cond...")
 
(C#)
Line 20: Line 20:
  
 
===C#===
 
===C#===
 +
Remember to check if something is equal in C# is '=='.
 +
 +
Remember 'Greater than or Equal' or Less than or Equal' is '>=' or '<='.
 +
 
<syntaxhighlight lang=c#>
 
<syntaxhighlight lang=c#>
 
while (factorfound == false)
 
while (factorfound == false)

Revision as of 13:17, 18 January 2019

Assigning a value

'←' is to assign a value to a variable, essentially just like '=' in C#.

While Loop

The command words used in the exam questions is:

WHILE (Condition)
     ....................
ENDWHILE

Condition will be something which equates to either true or false. Some examples of the conditions are:

WHILE (root * root) < Number

or:

WHILE (factorfound = false)

So the condition is always contained within the round brackets.

C#

Remember to check if something is equal in C# is '=='.

Remember 'Greater than or Equal' or Less than or Equal' is '>=' or '<='.

while (factorfound == false)
{
     ............
}