MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is a condition?
A
A decision
B
A situation that is checked every time iteration occurs
C
A type of iteration
D
None of the above
Explanation: 

Detailed explanation-1: -A condition is a situation that is checked every time an iteration occurs. The following is a 12-step algorithm for cleaning a person’s upper teeth, and supposes that they have ten top teeth: put toothpaste on toothbrush. use toothbrush to clean tooth 1.

Detailed explanation-2: -Iteration is the process of repeating steps. For example, a very simple algorithm for eating breakfast cereal might consist of these steps: put cereal in bowl. add milk to cereal.

Detailed explanation-3: -Why is iteration important? Iteration allows us to simplify our algorithm by stating that we will repeat certain steps until told otherwise. This makes designing algorithms quicker and simpler because they don’t have to include lots of unnecessary steps.

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: -Second unscrew cap Third Add water & toothpaste to toothbrush. Fourth: Screw toothpaste back up and replace Fifth: Open Mouth. Sixth: Scrub your teeth. Seventh : Repeat till spit builds up Eighth: Spit and repeat from step 6 until teeth are clean or until gums are bleeding.

There is 1 question to complete.