Define each of the categories to which the operations used to construct algorithms belong. Provide two to three examples within each category.
What will be an ideal response?
All the operations used to construct algorithms belong to one of only three categories:Sequential operations. A sequential instruction carries out a single well-defined task. When that task is finished, the algorithm moves on to the next operation. Sequential operations are usually expressed as simple declarative sentences.• Add 1 cup of butter to the mixture in the bowl.• Subtract the amount of the check from the current account balance.• Set the value of x to 1.Conditional operations. These are the "question-asking" instructions of an algorithm. They ask a question, and the next operation is selected on the basis of the answer to that question.• If the mixture is too dry, then add one-half cup of water to the bowl.• If the amount of the check is less than or equal to the current account balance, then cash the check; otherwise, tell the person there are insufficient funds.• If x is not equal to 0, then set y equal to 1/x; otherwise, print an error message that says you cannot perform division by 0.Iterative operations. These are the "looping" instructions of an algorithm. They tell us not to go on to the next instruction but, instead, to go back and repeat the execution of a previous block of instructions.• Repeat the previous two operations until the mixture has thickened.• While there are still more checks to be processed, do the following five steps.• Repeat Steps 1, 2, and 3 until the value of y is equal to 1.
You might also like to view...
Instance variables or methods declared with the modifier are accessible only in that class definition.
a) protected b) static c) private d) None of the above.
MC Schemas use__________ and are actually XML documents.
a) EBNF grammar. b) XML syntax. c) Both a and b. d) None of the above.
To hide a block-level element, assign a value of ____ to the display property.
A. hide B. none C. noblock D. 0
One thing that a spammer is not able to spoof is the originating IP address of the host that sent the message
a. True b. False