1) In what situation might you want to use a global variable? a) When you want to declare a variable that needs to be accessed only by a programming construct. b) When you want to release the memory of the variable once you have finished with it. c) When you want to declare a variable that needs to be accessible by all parts of your code. d) When you want to store large amount of data. 2) Why is it a good idea to use local variables instead of global variables? a) Global variables' memory is permanent. b) Local variables release memory when you have finished with them. c) Global variables release memory when you have finished with them. d) Local variables memory is temporary. 3) What is the difference between a global and a local variable? a) Global variables are accessible from all parts of the program. b) Local variables are accessible from all parts of the program. c) Global variable are not accessible from programming constructs such as loops. d) Local variables can only hold a small amount of data. 4) Identify the statement that refers to a global variable. a) Declared anywhere within a program b) Declared outside of a function or procedure c) Exists in multiple programs at a time d) Can only be composite data types. 5) Identify the global variables in this Python code a) colours, names b) names[1] c) blue, green, red, yellow d) blue 6) Identify the statement that refers to a local variable. a) Exists outside of a function or procedure b) Declared in multiple programs at a time c) Declared inside of a function or procedure d) Can only be composite data types 7) Identify the local variables in this Pseudocode. a) total, i b) itemPrices, totalPrice c) total, i, prices[i] d) total, i, LEN(prices)
0%
GCSE.Unit2.T5.Variable Scope
共有
共有
共有
Mrszhong
さんの投稿です
KS4
KS5
Y9
Y10
Y11
Computing
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
もっと表示する
表示を少なくする
このリーダーボードは現在非公開です。公開するには
共有
をクリックしてください。
このリーダーボードは、リソースの所有者によって無効にされています。
このリーダーボードは、あなたのオプションがリソースオーナーと異なるため、無効になっています。
オプションを元に戻す
クイズ
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?