Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
17 views

Retake Algorithm

Uploaded by

Mạnh Đức
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Retake Algorithm

Uploaded by

Mạnh Đức
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

1. Which of the following is not part of solution planning?

A. Control structures
B. Solution Algorithm
C. Code checking
D. Defining the problem
2. What is data for output of an algorithm to answer “How fast is a car travelling if it goes
50 miles in 2 hours?”
A. Two numbers of distance and time
B. A number giving the speed in miles per hour
C. A string “How fast is a car travelling if it goes 50 miles in 2 hours?”
3. With m = 70, n = 25, what is the value of returned m?
Pseudocode:
Algorithm Euclid(m, n)
while n ≠ 0 do
r  m mod n
mn
nr
return m
A. 5
B. 7
C. 6
D. 12
4. Which is the flow control?

A. Linear
B. Loop
C. Branching
D. Sequential

5. What is the best describing for Problem solving?


A. Convert the solution into a computer
B. Make up an algorithm
C. Must be created by programmers
D. Develop a solution to a problem
6. Which of the following is not correct about pseudocode?
A. Instructions may be written using mathematics
B. It can be compiled to a machine code
C. Looks like programming languages
7. Which is the flow control?

A. Branching
B. Loop
C. Linear
D. Sequential
8. In this algorithm, which instruction is missed?

A. Set Ai to Largest-so-far
B. Set Largest-so-far to Ai
C. Set Ai to Ai
D. Set i to n
9. What are possible problems that algorithm can solve?
A. Making a cup of tea
B. None of them
C. Passing this course
D. Determining if a number is prime
10.What should you learn to design algorithms?
A. Control structures
B. Programming languages
C. Requirement definitions
D. Pseudocode
11.What should we do initially before writing iteration/loop instruction?
A. Delete some values for variables
B. Clear some values for variables
C. Sum some values for variables
D. Set some values for variables
12. How many age of users will be printed out to a screen?

A. 11
B. 8
C. 9
D. 10
13. Which is the output of the algorithm?

A. 1,2,3,4,5
B. 2,3,4
C. 1,2,3,4
D. 2,3,4,5
14. Print “Enter two values”
get a, get b
if the value of a is larger than the value of b then
print a
else
print b
What does the program printf if the user enter 10 and 13?
A. 23
B. 10
C. 13
15. Which is the output of the algorithm?

A. 2,3,4,5
B. 2,3,4,5,6
C. 1,2,3,4
D. 1,2,3,4,5
16. Input 50, 20, 30, 40, 10, 5… After how many iterations will the loop break?

A. 2
B. 1
C. 3
D. 4
17.Which of the following is crucial is defining a problem clearly?
A. Specific objectives
B. Ignoring constraints
C. Vague goals
D. Random assumptions
18.What is pattern recognition in computational thinking?
A. Identifying similar problems
B. Ignoring differences
C. Identifying similar algorithms
D. Breaking down problems
19.What is correct pseudocode instruction?
A. Set a to b
B. Set 1 to a
C. Add 1 + b
D. Set a + b + 3
20.In this algorithm, which instruction is missed?

A. Set the value of i to 10000


B. Add 1 to the value of i
C. Else Add 1 to the value of i
D. Set the value of Found to “Yes”
21.What is the best definition for Flowchart?
A. Logically depict the steps to carry out a task and show how the steps relate to each
other
B. Graphically depict the logical steps to carry out a task and show how the steps relate
to each other
C. Wordly depitc the logical steps to carry out a task and show how the steps relate to
each other
D. Graphically depict the logical variables for a task and show how the they relate to
each other
22. Write down a pseudocode for this flowchart?

Begin
users  1
while users <= 10
read age
print age
users = users + 1
endwhile
End
23.What is the name of this flowchart symbol?

A. Procession
B. Input/Output
C. Decision
D. Terminal
24.What is important data for input of Area of a rectangle calculating algorithm?
A. Area and width
B. Perimeter
C. Length and Width
D. Width
25.What are algorithms possibly used by Zoom meeting software?
A. Website WebRanking
B. H264 compressing
C. Data transmitting
D. Multi users sharing
26.Which is not a type of variable?
A. Number
B. Sum
C. Array
27.Which of the following is not correct about algorithm?
A. Algorithms can not be used in any programming language
B. Algorithms are not a program
C. Algorithms have a lot of structure
28.Which component involves breaking down a complex problem into smaller, more
manageable parts?
A. Pattern Recognition
B. Decomposition
C. Abstract Thinking
D. Algorithm Design
29.When is the algorithm going to stop?

A. Nonstop
B. a = 10
C. a = 11
D. i = 10
30.What is required for algorithm?
A. Mechanically-executable
B. Ambiguous
C. Precise
D. Explicit
31.What is an algorithm?
A. A sequence of unambiguous instructions for solving a problem
B. Method of mathematics
C. A sequence of hidden instructions for solving a problem
D. A program running in a computer
32.Analyze this algorithm for correction of each instruction

Correct Incorrect
Line 6 x
Line 5 x
Line 4 x

33.What is the name of this flowchart structure?

A. Sequential
B. Do Until
C. While loop
D. Decision
34.Which is the flow control?

A. Branching
B. Sequential
C. Linear
D. Loop
35.With m = 60, n = 24, when the algorithm goes to Step 3 first time, what is the value of t?

A. 20
B. 24
C. 22
D. 23
36.Which of the following are necessary when we define a problem?
A. Program language
B. Output
C. Processing
D. Input

You might also like