Control Structures:
A program does not always stick to a linear string of instructions. During the process, it may diverge, reiterate the code, or take decisions. Control structures are therefore used for specifying what the program needs to do, when, and under what conditions. There are two types of control structures ¾ branching structures and looping structures. We will discuss each of these briefly.
Branching structures
Branching structures are used to transfer controls from one step to another in a program code. Examples of branching structures are:
- If - ‘If' statements are used to transfer control on the basis of certain conditions.
- Nested If - ‘Nested If' statements are used to check conditions within another condition.
- If Else - ‘If Else' statements are used to specify operations based on certain conditions. For example, if the condition is satisfied, perform task 1, else, perform task 2.
- Switch - ‘Switch' statements are used to check for multiple values of variables.
Looping structures
Looping structures are used in programs to perform repetitive tasks. Examples of looping are:
- While - ‘While' statements are used to repeat a statement or a block until the conditional expression is true.
- Do While - When it is desirable to execute the loop at least once, ‘Do While' is used. In this statement, the conditional expression is evaluated at the end of the loop.
For - ‘For' loops are used to perform a task a specific number of times on the basis of the condition. The ‘for' statement has three parts - initialization, condition, and iteration. Initialization is used to start the loop execution, condition to specify the condition, and iteration to increment or decrement the loop.
Pseudocode
Pseudocode is another tool used for planning program logic. As the name suggests, pseudocode means "imitation code." A pseudocode is a type of structured English that is used for describing algorithms. It is a summarized program which is written in a form that can easily be converted into real programming statements. The pseudo instructions are written in natural languages (e.g. English, French, German, etc). They do not need any language syntax rules or formatting rules.
Instead of using symbols to describe the logical steps of a program (as in flow charting), the pseudocode uses a structure that resembles computer instructions. As it lays emphasis on the design of the program, the pseudocode is also called Program Design Language (PDL). The common processing procedures used in a pseudocode are ‘sequence selection' and ‘iteration'. They are of immense use in designing program logic.
Email based Information technology and system assignment help - homework help at Expertsmind
Are you searching Computer science expert for help with Control Structures questions? Control Structures topic is not easier to learn without external help? We at www.expertsmind.com offer finest service of Information technolgy and system assignment help and Information technology homework help. Live tutors are available for 24x7 hours helping students in their Control Structures related problems. We provide step by step Control Structures question's answers with 100% plagiarism free content. We prepare quality content and notes for Control Structures topic under Information technology theory and study material. These are avail for subscribed users and they can get advantages anytime.
Why Expertsmind for assignment help
- Higher degree holder and experienced experts network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving Information Technolgoy and system queries in excels and word format.
- Best tutoring assistance 24x7 hours