Pseudo code does not have key words, you make it up, that's why it is pseudo.
count = count + 1
There is no standard for pseudocode. Pseudocode is generally expected to be intuitively understood by its target audience, but it doesn't need similarity with natural language or familiar programming language. Therefore, all the following are pseudocode examples to increment a variable called rep: rep = rep + 1 add 1 to rep increment rep ++rep next rep
Fixed loop: this is the loop where the number of iterations are known. Variable loop: Here the number of iterations are not known Example for a variable loop. The pseudocode for variable whille loop begin character cchoice display"enter the choice" accept cchoice while(cchoice='y') begin //execute the statements end end Rkarthikeyan
Most programming languages have some loop construct, that make it possible to repeat commands several times. The available commands vary, depending on the language; as an example, Java has the "for", "while", and "do...while" keywords.
No. Pseudocode is not used to write complete programs; rather, it is an overview of what you want to achieve. For example, the following pseudocode is for a program to print a list of square roots: for i = 1 to 10 show i, i*i A specific programming language may not have a "show" command, and the structure of the "for" loop might be different; additional setup and cleanup commands may also be required in a real computer program; the purpose of this pseudoce is merely to explain, to a human, what you want to achieve. The real code, with more detail, will have to be added later.
count = count + 1
There is no standard for pseudocode. Pseudocode is generally expected to be intuitively understood by its target audience, but it doesn't need similarity with natural language or familiar programming language. Therefore, all the following are pseudocode examples to increment a variable called rep: rep = rep + 1 add 1 to rep increment rep ++rep next rep
There is no standard for pseudocode. Pseudocode is generally expected to be intuitively understood by its target audience, but it doesn't need similarity with natural language or familiar programming language. Therefore, all the following are pseudocode examples to increment a variable called rep: rep = rep + 1 add 1 to rep increment rep ++rep next rep
input number for loop = 1 to 3 inclusive print number end for
An infinite loop is one sequence of commands that just repeats over and over again forever. When it comes to creating an infinite loop you can use the: for do while and do statements. using the keywords 'true'
Fixed loop: this is the loop where the number of iterations are known. Variable loop: Here the number of iterations are not known Example for a variable loop. The pseudocode for variable whille loop begin character cchoice display"enter the choice" accept cchoice while(cchoice='y') begin //execute the statements end end Rkarthikeyan
The for loop is especially useful for flow control when you already know how many times you need to execute the statements in the loop's block. The for loop declaration has three main parts, besides the body of the loop: • Declaration and initialization of variables • The boolean expression (conditional test) • The iteration expression The three for declaration parts are separated by semicolons. The following two examples demonstrate the for loop. The first example shows the parts of a for loop in a pseudocode form, and the second shows a typical example of a for loop. for (/*Initialization*/ ; /*Condition*/ ; /* Iteration */) { /* loop body */ } Ex: for (int i = 0; i<10; i++) { System.out.println("i is " + i); }
Most programming languages have some loop construct, that make it possible to repeat commands several times. The available commands vary, depending on the language; as an example, Java has the "for", "while", and "do...while" keywords.
The for loop is especially useful for flow control when you already know how many times you need to execute the statements in the loop's block. The for loop declaration has three main parts, besides the body of the loop: • Declaration and initialization of variables • The boolean expression (conditional test) • The iteration expression The three for declaration parts are separated by semicolons. The following two examples demonstrate the for loop. The first example shows the parts of a for loop in a pseudocode form, and the second shows a typical example of a for loop. for (/*Initialization*/ ; /*Condition*/ ; /* Iteration */) { /* loop body */ } Ex: for (int i = 0; i<10; i++) { System.out.println("i is " + i); }
Actually, a for loop is more appropriate in this case. With while, it would be something like the following pseudocode - adapt to your favorite programming language:function factorial(n)result = 1factor = 1while factor
No. Pseudocode is not used to write complete programs; rather, it is an overview of what you want to achieve. For example, the following pseudocode is for a program to print a list of square roots: for i = 1 to 10 show i, i*i A specific programming language may not have a "show" command, and the structure of the "for" loop might be different; additional setup and cleanup commands may also be required in a real computer program; the purpose of this pseudoce is merely to explain, to a human, what you want to achieve. The real code, with more detail, will have to be added later.
Well, from my knowledge of pseudocode, a pre-test loop contains the DO WHILE and LOOP functions. So say you want to pour some milk into your cereal for breakfast: DO WHILE cereal_bowl.Full = False Pour_Milk LOOP Basically this is you saying, I am going to pour milk WHILE the bowl is not full. Once the bowl is full you will stop because you checked before your poured (a pre-test). Hope this helps. - The Doctor