COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
IF
|
|
THEN
|
|
ELSE
|
|
None of the above
|
Detailed explanation-1: -The ELSE IF instruction allows there to be more than two paths through an algorithm . Any number of ELSE IF instructions can be added to an algorithm. It is used along with other instructions: IF represents a question.
Detailed explanation-2: -In programming, selection is usually represented by the statements IF and ELSE: IF represents the question. ELSE points to what to do if the answer to the question is false.
Detailed explanation-3: -In Python, elif is short for “else if” and is used when the first if statement isn’t true, but you want to check for another condition. Meaning, if statements pair up with elif and else statements to perform a series of checks. A full if/elif/else block is in the code example below.
Detailed explanation-4: -Representing iteration in pseudocode Writing in pseudocode is rather like writing in a programming language . Each step of the algorithm is written on a line of its own, in sequence.
Detailed explanation-5: -Pseudocode is an artificial and informal language that helps programmers develop algorithms. Pseudocode is a “text-based” detail (algorithmic) design tool. The rules of Pseudocode are reasonably straightforward. All statements showing “dependency” are to be indented. These include while, do, for, if, switch.