AA precise set of rules or instructions to solve a specific problem
BA type of computer hardware
CA programming language
DA data structure
2.Which of the following is NOT a method for designing an algorithm?
Easy
AStructure diagrams
BFlowcharts
CPseudocode
DBinary search
3.In a flowchart, which shape is used to represent a decision?
Easy
ARectangle
BDiamond
COval
DParallelogram
4.What does a structure diagram show?
Easy
AThe flow of control through an algorithm
BHierarchical top-down design, breaking a problem into sub-problems
CThe exact syntax of a programming language
DThe data types used in a program
5.In pseudocode, which of the following is the correct way to output a message?
Easy
AOUTPUT 'Hello'
Bprint('Hello')
CPRINT 'Hello'
DDISPLAY 'Hello'
6.Consider the following pseudocode:
Count ← 1
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count > 10
OUTPUT Total
What does this algorithm do?
Medium
AIt outputs the sum of ten numbers entered by the user
BIt outputs the average of ten numbers entered by the user
CIt outputs the largest of ten numbers entered by the user
DIt outputs the count of numbers entered
7.In the following pseudocode, what is stored in Grade[2] if the input Score[2] is 65?
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← 'A'
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← 'B'
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← 'C'
ELSE
IF Score[Count] ≥ 40 THEN
Grade[Count] ← 'D'
ELSE
IF Score[Count] ≥ 30 THEN
Grade[Count] ← 'E'
ELSE
Grade[Count] ← 'F'
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
Medium
A'B'
B'A'
C'C'
D'D'
8.Which of the following is a characteristic of pseudocode?
Easy
AIt uses strict syntax like a programming language
BIt is a visual tool using shapes
CIt uses short English words/statements to describe an algorithm
DIt is written in binary
更多题目
9.In a flowchart, what does a parallelogram represent?
Easy
AInput/Output
BProcess
CDecision
DStart/End
10.An algorithm uses a variable Total that is initialised to 0. The algorithm then inputs 5 numbers and adds each to Total. Finally it outputs Total divided by 5. What does this algorithm calculate?
Easy
AThe sum of the numbers
BThe average of the numbers
CThe product of the numbers
DThe maximum of the numbers
11.What is the purpose of a structure diagram?
Easy
ATo show the flow of control in a program
BTo break a problem into smaller sub-problems
CTo write the exact code of a program
DTo test the algorithm with different inputs
12.Which of the following is the correct pseudocode to input a value into a variable called Age?
Easy
AINPUT Age
BAge = input()
CREAD Age
DGET Age
13.A teacher uses the following algorithm to assign grades to 30 students. What grade is assigned to a student with a score of 55?
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← "A"
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← "B"
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← "C"
ELSE
IF Score[Count] ≥ 40 THEN
Grade[Count] ← "D"
ELSE
IF Score[Count] ≥ 30 THEN
Grade[Count] ← "E"
ELSE
Grade[Count] ← "F"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
Medium
AA
BB
CC
DD
14.What does a structure diagram represent?
Easy
AThe flow of control in an algorithm
BA hierarchical top-down decomposition of a problem
CThe syntax of a programming language
DThe input and output of a program
15.In a flowchart, which shape represents a decision?
Easy
ARectangle
BParallelogram
CDiamond
DOval
16.Consider the following pseudocode:
Count ← 1
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count > 10
OUTPUT Total
How many numbers are input in total?
Medium
A9
B10
C11
D1
17.Given the following pseudocode, what is the value of X after execution?
X ← 0
FOR I ← 1 TO 4
FOR J ← 1 TO I
X ← X + 1
NEXT J
NEXT I
Hard
A10
B8
C6
D4
18.A flowchart uses a parallelogram shape. What does it represent?
Easy
AProcess
BInput/Output
CDecision
DStart/End
19.An algorithm uses a variable Total initialised to 0. It inputs 5 numbers and adds each to Total. Finally it outputs Total divided by 5. What does this algorithm do?
Easy
ACalculates the sum of the numbers
BCalculates the average of the numbers
CCalculates the product of the numbers
DCalculates the maximum of the numbers
20.What does a parallelogram represent in a flowchart?
Easy
AInput/Output
BProcess
CDecision
DStart/End
21.Given the following pseudocode, what is stored in Grade[2] if the input Score[2] is 65?
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← "A"
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← "B"
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← "C"
ELSE
IF Score[Count] ≥ 40 THEN
Grade[Count] ← "D"
ELSE
IF Score[Count] ≥ 30 THEN
Grade[Count] ← "E"
ELSE
Grade[Count] ← "F"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
Medium
A"B"
B"C"
C"A"
D"D"
22.Consider the following pseudocode:
Count ← 1
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count > 10
OUTPUT Total
How many times does the loop execute?
Medium
A10
B9
C11
D0
23.In the following pseudocode, what is stored in Grade[2] if the input Score[2] is 65?
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← 'A'
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← 'B'
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← 'C'
ELSE
Grade[Count] ← 'F'
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
Medium
A'B'
B'A'
C'C'
D'F'
24.Consider the following pseudocode:
Count ← 0
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count = 10
OUTPUT Total
How many numbers does the user input?
Medium
A9
B10
C11
D0
25.Consider the following pseudocode:
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← 'A'
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← 'B'
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← 'C'
ELSE
IF Score[Count] ≥ 40 THEN
Grade[Count] ← 'D'
ELSE
IF Score[Count] ≥ 30 THEN
Grade[Count] ← 'E'
ELSE
Grade[Count] ← 'F'
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
What is stored in Grade[2] if the input Score[2] is 65?
Medium
A'A'
B'B'
C'C'
D'D'
26.In a flowchart, what shape is used to represent a decision?
Easy
ARectangle
BDiamond
CParallelogram
DOval
27.Given the following pseudocode:
Count ← 1
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count > 10
OUTPUT Total
What does the algorithm output?
Medium
AThe sum of the first 10 numbers input
BThe sum of the first 11 numbers input
CThe total of numbers input until a number >10 is entered
DThe average of the numbers input
28.A teacher uses the following algorithm to assign grades to 30 students:
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← 'A'
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← 'B'
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← 'C'
ELSE
IF Score[Count] ≥ 40 THEN
Grade[Count] ← 'D'
ELSE
IF Score[Count] ≥ 30 THEN
Grade[Count] ← 'E'
ELSE
Grade[Count] ← 'F'
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
What grade is assigned to a student with a score of 55?
Medium
AA
BB
CC
DD
29.Consider the following pseudocode:
X ← 0
FOR I ← 1 TO 4
FOR J ← 1 TO I
X ← X + 1
NEXT J
NEXT I
What is the value of X after execution?
Medium
A10
B16
C4
D6
30.An algorithm uses a variable Total initialised to 0. It inputs 5 numbers and adds each to Total. Finally it outputs Total divided by 5. What does this algorithm calculate?
Easy
ASum of the numbers
BAverage of the numbers
CProduct of the numbers
DCount of numbers
31.Consider the following pseudocode:
Count ← 0
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count = 10
OUTPUT Total / Count
What does this algorithm output?
Medium
ASum of 10 numbers
BAverage of 10 numbers
CSum of 9 numbers
DAverage of 9 numbers
32.Consider the following pseudocode:
Total ← 0
FOR I ← 1 TO 3
INPUT N
Total ← Total + N
NEXT I
OUTPUT Total
If the user inputs 5, 10, and 15, what is the output?
Easy
A30
B25
C20
D35
33.In the following pseudocode, what is the purpose of the algorithm?
Count ← 0
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count = 10
OUTPUT Total / Count
Medium
AIt inputs 10 numbers and outputs the total
BIt inputs 10 numbers and outputs the average
CIt inputs numbers until a negative number is entered and outputs the sum
DIt inputs 10 numbers and outputs the largest number
34.Which shape in a flowchart represents a process?
Easy
AOval
BRectangle
CDiamond
DParallelogram
35.Consider the following pseudocode:
Total ← 0
FOR I ← 1 TO 5
FOR J ← 1 TO I
Total ← Total + 1
NEXT J
NEXT I
OUTPUT Total
What is output?
Medium
A5
B10
C15
D20
36.Which of the following is correct pseudocode to input a value into a variable called Age and then output it?
Easy
AINPUT Age
OUTPUT Age
BAge = input()
print(Age)
CREAD Age
WRITE Age
DGET Age
PUT Age
37.The pseudocode below is intended to find the highest number in a list of 10 numbers. However, it contains a logic error. What is the error?
Max ← 0
Count ← 0
REPEAT
INPUT Number
IF Number > Max THEN
Max ← Number
ENDIF
Count ← Count + 1
UNTIL Count = 10
OUTPUT Max
Hard
AMax should be initialised to a very small number instead of 0
BThe loop should repeat until Count > 10
CThe IF condition should be Number < Max
DThe variable Count should be initialised to 1
38.The following pseudocode searches an array Score[0..9] for a value Target. What is output if Target is 45 and Score contains {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}?
Found ← False
Index ← 0
REPEAT
IF Score[Index] = Target THEN
Found ← True
ENDIF
Index ← Index + 1
UNTIL Found = True OR Index = 10
IF Found = True THEN
OUTPUT Index - 1
ELSE
OUTPUT -1
ENDIF
Hard
A3
B4
C-1
D45
39.What does the diamond shape represent in a flowchart?
Easy
AStart/End
BProcess
CDecision
DInput/Output
40.Which of the following is the correct definition of an algorithm?
Easy
AA precise set of rules or instructions to solve a specific problem or task
BA high-level programming language
CA diagram showing the flow of data in a system
DA type of computer hardware
41.Which shape is used in a flowchart to represent a process?
Easy
ARectangle
BDiamond
CParallelogram
DOval
42.What is pseudocode?
Easy
AA visual representation of an algorithm using shapes
BA text-based tool that uses short English words/statements to describe an algorithm
CA high-level programming language like Python
DA diagram showing hierarchical top-down design
43.A structure diagram shows the flow of control in an algorithm.
Easy
True or false?
44.In a flowchart, what does a diamond shape represent?
Easy
AA process
BA decision
CInput/Output
DStart/End
45.Which of the following is NOT a benefit of using pseudocode to design an algorithm?
Medium
AIt is easier to understand than code
BIt can be directly executed by a computer
CIt is less likely to contain syntax errors
DIt can be easily translated into any programming language
46.Arrange the following steps in the correct order for a typical algorithm that finds the average of five numbers: (a) OUTPUT average, (b) total ← total + number, (c) total ← 0, (d) REPEAT five times, (e) INPUT number.
Medium
total ← 0
REPEAT five times
INPUT number
total ← total + number
OUTPUT average
47.Consider the following pseudocode:
Count ← 1
Total ← 0
REPEAT
INPUT Number
Total ← Total + Number
Count ← Count + 1
UNTIL Count > 10
OUTPUT Total
How many numbers does the user input?
Medium
A9
B10
C11
D12
48.Which of the following is a correct pseudocode statement to output the value of a variable called Age?
Easy
AOUTPUT Age
BPRINT(Age)
COUTPUT "Age"
49.A structure diagram is used to show the hierarchical breakdown of a problem into sub-problems.
Easy
True or false?
50.Match each flowchart shape to its correct function.
Easy
Oval
Parallelogram
Diamond
Rectangle
Start/End
Input/Output
Decision
Process
51.State the three main ways to design an algorithm.
Easy
52.Describe what happens in the following algorithm:
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] ≥ 70 THEN
Grade[Count] ← "A"
ELSE
IF Score[Count] ≥ 60 THEN
Grade[Count] ← "B"
ELSE
IF Score[Count] ≥ 50 THEN
Grade[Count] ← "C"
ELSE
IF Score[Count] ≥ 40 THEN
Grade[Count] ← "D"
ELSE
IF Score[Count] ≥ 30 THEN
Grade[Count] ← "E"
ELSE
Grade[Count] ← "F"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30