I have trouble writing pseudo codes, while and for loops.

Please help.

Assistance needed.

Pseudocodes are basically programming in English, describing exactly what you would do to solve the problem, without the constraint of syntax of languages.

Loops are repetitive tasks that allow you to find information you need, getting off the loop once the information is found.

If you want, you can post a pseudocode to find a particular listing from a telephone book, or a word from a paper dictionary. We will be able to better help you where help is needed.

Suggestions:

1. The best way to learn to code is to read example codes in textbooks, class notes, or tutorials.
2. In case there code that is hard to understand, or concepts difficult to grasp, post the example, or concept for explanations.

I would have posted some tutorial sites for you if I knew the language in which you programme. You can easily google a few, and if you need recommendations, post again.

Sure! I can help you with that. First, let's start by explaining what pseudo code is.

Pseudo code is a way to express your algorithm in plain English or a combination of plain English and programming language syntax. It is a step-by-step description of what your program needs to do, without getting into the specifics of any particular programming language. Pseudo code is a great way to plan out your program's logic before you start coding.

Now, let's move on to explaining while and for loops.

A while loop is a control flow statement that allows you to repeat a block of code as long as a given condition is true. The structure of a while loop usually consists of the keyword "while" followed by a condition in parentheses, and then the block of code to be executed, enclosed in curly braces. Here's an example:

```
while (condition) {
// code to be executed
}
```

The condition is evaluated before each iteration of the loop. If the condition is true, the block of code inside the loop is executed. After each iteration, the condition is checked again. If the condition is still true, the loop continues. If the condition is false, the loop ends, and the program continues with the next line of code after the loop.

A for loop, on the other hand, is a control flow statement that allows you to repeat a block of code a specific number of times. It's often used when you know how many iterations you want to perform. The structure of a for loop consists of three parts: initialization, condition, and increment/decrement. Here's an example:

```
for (initialization; condition; increment/decrement) {
// code to be executed
}
```

The initialization is usually a statement that performs an initial setup, such as declaring and initializing variables. The condition is evaluated before each iteration, just like in a while loop. If the condition is true, the block of code inside the loop is executed. After each iteration, the increment/decrement statement is executed. This statement is responsible for changing the loop control variable, which helps eventually make the condition false and end the loop.

To write pseudo code for while and for loops, you can follow these steps:

1. Determine the conditions under which your loop should continue executing.
2. Write the initialization code if using a for loop, or any necessary setup code before the loop.
3. Begin the loop by writing either `while (condition)` or `for (initialization; condition; increment/decrement)`.
4. Inside the loop, write the code that should be executed each iteration.
5. Test the condition at the end of each loop iteration to determine whether the loop should continue.
6. End the loop by closing the loop block with curly braces.
7. Continue with the code after the loop.

Remember, pseudo code doesn't have to be syntactically correct or follow any specific programming language rules. Its purpose is to help you plan out the logic of your code. You can use plain English or simplified programming language syntax, whatever is most comfortable for you.

I hope this explanation helps! Let me know if you have any further questions.