M2S1 Flashcards
Q: What is an algorithm?
A: An algorithm is a procedure or formula for solving a problem, based on conducting a sequence of specified actions.
Q: How can an algorithm be expressed?
A: An algorithm can be expressed using pseudocode or flowcharts.
Q: What is the purpose of planning an algorithm?
A: To transform the problem’s input into its output.
Q: In the IPO chart, what does “Process” represent?
A: The processing part involves recording instructions to manipulate the input items to achieve the desired output.
Q: What should each instruction in an algorithm begin with?
A: Each instruction should start with a verb.
Q: What is typically the first instruction in an algorithm?
A: To enter the input items into the computer.
Q: What do most algorithms end with?
A: An instruction to display, print, or store the output items.
Q: What do the terms “display,” “print,” and “store” refer to?
A: They refer to showing output on the computer screen, sending it to a printer, and saving it to a file on a disk, respectively.
Q: Why is pseudocode called “false code”?
A: Because it has no syntax like any programming language and cannot be compiled or interpreted by a computer.
Q: What does pseudocode represent?
A: It is an implementation of an algorithm using plain English annotations and informative text.
Q: Are there standardized forms of pseudocode?
A: No, pseudocode is not standardized, and each programmer may have their own version, though some similarities exist.
Q: What keywords indicate common input-output and processing operations in pseudocode?
A: Keywords such as INPUT, OUTPUT, PRINT, and COMPUTE are commonly used.
Q: How is the order of execution determined in pseudocode?
A: The order of execution is assumed to be from top to bottom, unless control structures, functions, or exception handling are used.
Q: What does the keyword “START” signify in pseudocode?
A: It marks the beginning of the pseudocode.
Q: How do you retrieve data from the user in pseudocode?
A: By using keywords like INPUT, ENTER, READ, or GET.