Algorithms and Flowcharts Review Flashcards

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/110

flashcard set

Earn XP

Description and Tags

Flashcard practice set covering module 02 on algorithms, flowcharts, control structures, Donald Knuth's properties, and exercises.

Last updated 3:35 AM on 8/26/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

111 Terms

1
New cards

How is an algorithm defined in general terms?

A sequence of activities to be processed for getting desired output from a given input.

2
New cards

How does Webopedia define an algorithm?

A formula or set of steps for solving a particular problem.

3
New cards

What two essential characteristics must a set of rules have to be considered an algorithm according to Webopedia?

They must be unambiguous and have a clear stopping point.

4
New cards

What condition regarding time must be met for an algorithm to yield an output?

The algorithm must stop after a finite time.

5
New cards

What two elements should be identified before writing an algorithm for a problem?

What the inputs to the algorithm are and what expected output is required after running it.

6
New cards

What symbol is used for Addition when writing algorithms in this material?

The symbol ++.

7
New cards

What symbol is used for Subtraction when writing algorithms?

The symbol -.

8
New cards

What symbol is used for Multiplication when writing algorithms?

The symbol *.

9
New cards

What symbol is used for Division when writing algorithms?

The symbol //.

10
New cards

What symbol is used for assignment operations when writing algorithms?

The symbol \leftarrow.

11
New cards

In the algorithm notation, what does the statement ax3a \leftarrow x*3 mean?

AA will have a value of x×3x \times 3.

12
New cards

What is the input to the algorithm for finding the area of a circle of radius rr?

Radius rr of the Circle.

13
New cards

What is the expected output for the algorithm finding the area of a circle?

Area of the Circle.

14
New cards

What is Step 1 of the algorithm to find the area of a circle of radius rr?

Step 1: Read // input the Radius rr of the Circle.

15
New cards

What is Step 2 calculation of the algorithm to find the area of a circle of radius rr?

Step 2: AreaPI×r×r\text{Area} \leftarrow \text{PI} \times r \times r // calculation of area.

16
New cards

What is Step 3 of the algorithm to find the area of a circle?

Step 3: Print Area.

17
New cards

What are the inputs to the algorithm that reads two numbers and finds their sum?

First number and Second number.

18
New cards

What is the expected output of the algorithm that reads two numbers and finds their sum?

Sum of the two numbers.

19
New cards

What is Step 1 of the algorithm for finding the sum of two numbers?

Step 1: Start.

20
New cards

What is Step 2 of the algorithm for finding the sum of two numbers?

Step 2: Read num1 // input the first num1.

21
New cards

What is Step 3 of the algorithm for finding the sum of two numbers?

Step 3: Read num2 // input the second num2.

22
New cards

What is Step 4 of the algorithm for finding the sum of two numbers?

Step 4: Sumnum1+num2\text{Sum} \leftarrow \text{num1} + \text{num2} // calculation of sum.

23
New cards

What is Step 5 of the algorithm for finding the sum of two numbers?

Step 5: Print Sum.

24
New cards

What is Step 6 of the algorithm for finding the sum of two numbers?

Step 6: End.

25
New cards

What is the input for the algorithm that converts temperature from Fahrenheit to Celsius?

Temperature in Fahrenheit FF.

26
New cards

What is the expected output for the temperature conversion algorithm?

Temperature in Celsius CC.

27
New cards

What is Step 1 of the algorithm to convert temperature from Fahrenheit to Celsius?

Step 1: Start.

28
New cards

What is Step 2 of the algorithm to convert temperature from Fahrenheit to Celsius?

Step 2: Read Temperature in Fahrenheit FF.

29
New cards

What formula is evaluated in Step 3 of the temperature conversion algorithm?

C(59)×(F32)C \leftarrow \left(\frac{5}{9}\right) \times (F - 32)

30
New cards

What is Step 4 of the algorithm to convert temperature from Fahrenheit to Celsius?

Step 4: Print Temperature in Celsius: C.

31
New cards

What is Step 5 of the algorithm to convert temperature from Fahrenheit to Celsius?

Step 5: End.

32
New cards

What are the three classification types of control structures for algorithms and flowcharts?

  1. Sequence, 2. Branching (Selection), 3. Loop (Repetition).
33
New cards

Are Sequence, Branching, and Loop structures sufficient for all algorithm purposes?

Yes, these three control structures are sufficient for all purposes.

34
New cards

How is the Sequence control structure defined?

It is exemplified by a sequence of statements placed one after the other, where the one above or before another gets executed first.

35
New cards

Which flowchart box shape usually contains a sequence of statements?

The rectangular process box.

36
New cards

What does Branching refer to in algorithms?

A binary decision based on some condition.

37
New cards

What construct usually represents Branching in pseudo-codes and programs?

The 'if-then' construct.

38
New cards

What flowchart symbol represents a decision in Branching?

The diamond-shaped decision box.

39
New cards

By what other name is the Branching control structure known?

The selection structure.

40
New cards

What are the inputs to Problem-1 (finding the greater number between two numbers)?

Number 1 (AA) and Number 2 (BB).

41
New cards

What is the expected output of Problem-1 (finding the greater number between two numbers)?

Greater number between AA and BB.

42
New cards

What is Step 3 in the algorithm to find the greater number between AA and BB?

Step 3: If AA greater than BB then C=AC = A.

43
New cards

What is Step 4 in the algorithm to find the greater number between AA and BB?

Step 4: If BB greater than AA then C=BC = B.

44
New cards

What are the inputs to Problem-2 (finding the largest value of any three numbers)?

Number 1 (AA), Number 2 (BB), and Number 3 (CC).

45
New cards

What is Step 3 in the algorithm to find the largest value of three numbers (AA, BB, CC)?

Step 3: If (ABA \ge B) and (ACA \ge C) then Max=A\text{Max} = A.

46
New cards

What is Step 4 in the algorithm to find the largest value of three numbers (AA, BB, CC)?

Step 4: If (BAB \ge A) and (BCB \ge C) then Max=B\text{Max} = B.

47
New cards

What is Step 5 in the algorithm to find the largest value of three numbers (AA, BB, CC)?

Step 5: If (CAC \ge A) and (CBC \ge B) then Max=C\text{Max} = C.

48
New cards

How is the Loop control structure defined?

It allows a statement or a sequence of statements to be repeatedly executed based on some loop condition.

49
New cards

Which constructs represent unbounded loops and bounded loops respectively in most programming languages?

'while' constructs for unbounded loops and 'for' constructs for bounded loops.

50
New cards

What is an unbounded loop?

A loop whose number of iterations depends on the eventuality that the termination condition is satisfied.

51
New cards

What is a bounded loop?

A loop whose number of iterations is known before-hand.

52
New cards

What flowchart feature hints the presence of a loop?

A back arrow.

53
New cards

What is a single trip around a loop known as?

An iteration.

54
New cards

What mistake occurs if the loop termination condition is never satisfied after finite iterations?

It ends up as an infinite loop.

55
New cards

What is another name for the Loop control structure?

The repetition structure.

56
New cards

In the algorithm to calculate even numbers between 00 and 9999, what initial value is assigned to II in Step 2?

I0I \leftarrow 0.

57
New cards

In the algorithm to calculate even numbers between 00 and 9999, what operation is performed in Step 4?

II+2I \leftarrow I + 2.

58
New cards

In the algorithm to calculate even numbers between 00 and 9999, what condition is checked in Step 5?

If (I98I \le 98) then go to step 3.

59
New cards

What is the dual purpose of Problem 2 on Page 5 regarding even numbers between 10001000 and 20002000?

It generates even numbers between 10001000 and 20002000, prints them, and prints their total sum.

60
New cards

In line 2 of the algorithm generating even numbers between 10001000 and 20002000, what are the initial variable assignments?

I1000I \leftarrow 1000 and S0S \leftarrow 0.

61
New cards

In line 4 of the algorithm generating even numbers between 10001000 and 20002000, how is the sum variable SS updated?

SS+IS \leftarrow S + I.

62
New cards

In line 5 of the algorithm generating even numbers between 10001000 and 20002000, how is the counter variable II updated?

II+2I \leftarrow I + 2.

63
New cards

What control logic is used in line 6 of the algorithm generating even numbers between 10001000 and 20002000?

If (I2000I \le 2000) then go to line 3 Else go to line 7.

64
New cards

Who authored the list of five properties for an algorithm mentioned in the module?

Donald Ervin Knuth.

65
New cards

What are the five properties of an algorithm given by Donald Ervin Knuth?

1) Finiteness, 2) Definiteness, 3) Input, 4) Output, 5) Effectiveness.

66
New cards

What does the property of Finiteness require of an algorithm?

An algorithm must always terminate after a finite number of steps.

67
New cards

What does the property of Definiteness require of an algorithm?

Each step of an algorithm must be precisely defined and unambiguous for each activity.

68
New cards

What does the property of Input mean for an algorithm?

Beginning values or quantities associated with activities are given to the algorithm before it begins.

69
New cards

What is the difference between an intermediate result and an end result in an algorithm?

An intermediate result is obtained at an intermediate stage of operation, while an end result is obtained at the end of the algorithm.

70
New cards

What relation must the output of an algorithm have to its inputs?

The output must always have a specified relation to the inputs.

71
New cards

What does the property of Effectiveness state regarding algorithm operations?

Operations should be basic enough that in principle they can be done exactly and in a finite amount of time by a person using paper and pencil only.

72
New cards

What is the definition of a Flowchart?

A pictorial representation of an algorithm; a diagram which visually presents the flow of data through processing systems.

73
New cards

What two key details can one determine by looking at a flowchart?

The operations performed and the sequence of these operations in a system.

74
New cards

How many basic flowchart symbols are commonly used in flow charting assembly language programs?

Six basic symbols.

75
New cards

What are the six basic symbols listed for assembly language program flowcharts?

Terminal, Process, Input/Output, Decision, Connector, and Predefined Process.

76
New cards

How does a decision-making flowchart help human beings and business organizations?

It helps people to make a decision correctly and quickly.

77
New cards

How does a flowchart help optimize decision steps?

It allows removal of duplicated steps because all steps are visible in the flowchart.

78
New cards

What does the expression A>BA > B represent in decision structures?

It is a logical expression that describes a condition we want to test.

79
New cards

In the IF-THEN-ELSE flowchart example on Page 9, what action is taken if A>BA > B is true?

Print the value of AA.

80
New cards

In the IF-THEN-ELSE flowchart example on Page 9, what action is taken if A>BA > B is false?

Print the value of BB.

81
New cards

What is the general pseudo-code format of an IF-THEN-ELSE structure?

if (condition) then True alternative else False alternative endif

82
New cards

What is meant by NESTED IFS?

When one of the alternatives within an IF-THEN-ELSE statement involves a further IF-THEN-ELSE statement.

83
New cards

In the Nested IF algorithm reading three numbers (N1,N2,N3N1, N2, N3), what is Step 1?

Step 1: Input N1,N2,N3N1, N2, N3.

84
New cards

In the Nested IF algorithm, if N1>N2N1 > N2 is true and N1>N3N1 > N3 is true, what is assigned to MAX\text{MAX}?

MAXN1\text{MAX} \leftarrow N1.

85
New cards

In the Nested IF algorithm, if N1>N2N1 > N2 is true but N1>N3N1 > N3 is false, what is assigned to MAX\text{MAX}?

MAXN3\text{MAX} \leftarrow N3.

86
New cards

In the Nested IF algorithm, if N1>N2N1 > N2 is false and N2>N3N2 > N3 is true, what is assigned to MAX\text{MAX}?

MAXN2\text{MAX} \leftarrow N2.

87
New cards

In the Nested IF algorithm, if N1>N2N1 > N2 is false and N2>N3N2 > N3 is false, what is assigned to MAX\text{MAX}?

MAXN3\text{MAX} \leftarrow N3.

88
New cards

What is the objective of Exercise 01 on Page 11?

Determine and output whether number NN is even or odd.

89
New cards

In Exercise 01, what is Step 2 of the algorithm?

Step 2: Set remainder as N(mod2)N \pmod 2.

90
New cards

In Exercise 01, under what condition is number NN classified as even?

If remainder is equal to 00.

91
New cards

What is the objective of Exercise 02 on Page 12?

Draw an algorithm and flowchart to log in to Facebook account.

92
New cards

In Exercise 02, what is Step 1 of the algorithm?

  1. Enter www.facebook.com in your browser. (I/O)
93
New cards

In Exercise 02, what operation type is assigned to Step 2 ("facebook Home page loads")?

PROCESS.

94
New cards

In Exercise 02, what operation type is assigned to Step 3 ("Enter your Email ID and Password")?

I/O (Input/Output).

95
New cards

In Exercise 02, if the Email ID and Password validation step is NO, what action occurs?

Log in error (PROCESS) and go to step 3.

96
New cards

In Exercise 02, if the Email ID and Password validation step is YES, what action occurs?

Display Facebook Account (I/O) and Stop.

97
New cards

What is the goal of Exercise 03 on Page 13?

Find Even number in between 11 to 5050.

98
New cards

In Exercise 03, what initial value is assigned to II in Step 2?

I=1I = 1.

99
New cards

In Exercise 03, what is the exit condition in Step 3?

IF (I>50I > 50) THEN GO TO Step-7 END IF.

100
New cards

In Exercise 03, what condition determines if II is displayed in Step 4?

IF ((I(mod2)I \pmod 2) = 00) THEN Display II END IF.