下列程式用以檢查 X 是否能被 7 整除。以下哪項可以填入.......位置?
X = 14
.........
print("It is divisible by 7")
S5 Programming Quiz
Quiz
•
Computers
•
10th Grade
•
Medium
Hiu Chan
Used 2+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
下列程式用以檢查 X 是否能被 7 整除。以下哪項可以填入.......位置?
X = 14
.........
print("It is divisible by 7")
if X == 7:
if X / 7 == 2:
if X % 7 == 0:
if X // 7 == 0:
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
以下哪個程式的輸出與下列算法相同?
i ← 1
當 i < 5
輸出 i
i ← i + 1
for i in range(1, 4):
print(i)
for i in range(1, 6):
print(i)
i = 1
while i < 5:
print(i)
i = 1
while i < 5:
print(i)
i = i + 1
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
以下哪項是模組化的好處?
減少程式的執行時間
使程式不須測試
使程式可重用
使用戶更容易使用程式
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
允行的程式未能產生正確輸出,因此他修改了程式的流程圖。以下哪項解難步驟最能貼切地描述他的動作?
分析問題
設計算法
開發程式
測試及除錯
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
已知 num 是大小為 10 的陣列,以下哪項是下列算法的目的?(陣列的索引由1開始。)
X ← num[ 1 ]
設 i 由 2 至 10
如果 num[ i ] > X 則
X ← num[ i ]
輸出 X
找出陣列 num 中的最大值
找出陣列 num 中的最小值
找出陣列 num 的最終值
找出陣列 num 的起始值
6.
MULTIPLE CHOICE QUESTION
2 mins • 2 pts
以下哪項是下列算法的目的 ?(陣列的索引由1開始。)
X[ ] ← [ 1, 2, 3, 4, 5, 4, 3, 2, 1 ]
Y ← True
i ← 1
當 i < 9 AND Y = True
如果 X[ i ] < X[ i + 1] 則
Y ← False
輸出 i
找出陣列停止由小至大排列的位置索引
找出陣列停止由大至小排列的位置索引
檢查陣列是否由小至大排列
檢查陣列是否由大至小排列
7.
OPEN ENDED QUESTION
5 mins • 4 pts
凱莉開發了子程式 swap(S, x),以將堆疊 S 中第 x 個和第 (x+1) 個鞋盒的位置交換。
(i)
她使用了一個空的堆疊 T 協助操作 swap(S, x)。試為凱莉完成 swap(S, x) 的偽代碼。 (4 分)
行號 偽代碼
1 子程式 swap(S, x)
2 設i 由 1 至 ___
3 push(T, pop(S))
4 temp ß pop(S)
5 push(S, _____)
6 push(S, _____)
7 設i 由 1 至 ___
8 push(S, pop(T))
Evaluate responses using AI:
OFF
11 questions
2024年第一学期编程复习
Quiz
•
9th - 12th Grade
8 questions
A2資訊處理:試算表操作
Quiz
•
9th - 12th Grade
10 questions
每日一ICT 14/11/2022-27/11/2022
Quiz
•
10th Grade
10 questions
0610-Microbit
Quiz
•
9th - 12th Grade
10 questions
3-1資料處理
Quiz
•
7th Grade - University
10 questions
顺序结构复习
Quiz
•
10th Grade
10 questions
台中市三年級資訊2-02數位學習高手-01主動學習樂
Quiz
•
3rd - 12th Grade
10 questions
雲端從業人員Module 6 知識點檢查
Quiz
•
9th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University