App Dev Worksheet: Variables, Lists and Saving
Developer's tip (Box, list, place): A variable holds one value; a list holds many in order. Positions start at 0. push adds to the end; pop takes off the last item; length is how many items. On the phone: works offline, private. In the cloud: shared, any device, needs the internet.
NameDateTime takenScore ___ / 40
-
1.💾 What number does this code show?
let score = 7;
score = score - 7;
score = score + 3;
show(score); - 2.💾 Which can hold many values in order? (a) a button (b) a switch (c) a list (d) a single number
-
3.💾 What does this code show? (Positions start at 0.)
let notes = ["Sports", "Maths", "Hindi"];
show(notes[0]); (a) Maths (b) Sports (c) Hindi - 4.Which of these fits saving in the cloud? (a) a draft you are typing (b) chat messages to friends (c) the sound on/off setting (d) your last game level
-
5.💾 What does this code show? (Positions start at 0.)
let notes = ["Art", "Sports", "Science"];
show(notes[2]); (a) Art (b) Sports (c) Science - 6.💾 Which works with no internet at all? (a) data saved on the phone (b) a cloud backup (c) a shared chat (d) a cloud leaderboard
- 7.True or false: a shared to-do list fits saving on the phone. (a) True (b) False
- 8.💾 Where should the app save the sound on/off setting: on the phone or in the cloud? (a) in the cloud (b) on the phone
- 9.Which of these fits saving in the cloud? (a) your last game level (b) a draft you are typing (c) a shared to-do list (d) the sound on/off setting
- 10.💾 Where should the app save a class leaderboard: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
11.💾 What does this code show? (Positions start at 0.)
let notes = ["Hindi", "Science", "Maths"];
show(notes[2]); (a) Science (b) Maths (c) Hindi - 12.True or false: the sound on/off setting fits saving on the phone. (a) True (b) False
- 13.Which of these fits saving on the phone? (a) chat messages to friends (b) the sound on/off setting (c) photos on two devices (d) a shared to-do list
-
14.💾 What number does this code show?
let friends = ["Riya", "Meera"];
friends.push("Kabir");
friends.push("Aman");
show(friends.length); - 15.💾 What is a variable? (a) a named box for a value (b) a phone setting (c) a picture (d) a type of screen
- 16.💾 Saving data in the cloud lets you ___. (a) skip the internet (b) shrink the app (c) never need a password (d) use it on any device
- 17.💾 Where should the app save your last game level: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
18.💾 What number does this code show?
let coins = 4;
coins = coins - 1;
coins = coins + 4;
show(coins); - 19.True or false: notes to read offline fits saving in the cloud. (a) False (b) True
- 20.💾 Data saved only on the phone is lost when ___. (a) the screen turns off (b) the phone is lost (c) the app is closed (d) you send a message
-
21.💾 pop() takes off the last item. What does this code show?
let songs = ["Sunrise", "Monsoon", "Stars"];
songs.pop();
show(songs[songs.length - 1]); (a) Monsoon (b) Stars (c) Sunrise -
22.💾 What does this code show? (Positions start at 0.)
let friends = ["Aman", "Zoya", "Kabir", "Arjun", "Riya"];
show(friends[4]); (a) Zoya (b) Riya (c) Aman (d) Kabir - 23.True or false: a draft you are typing fits saving on the phone. (a) True (b) False
-
24.💾 What number does this code show?
let coins = 4;
coins = coins - 3;
coins = coins + 5;
show(coins); - 25.💾 In most code, the first item of a list is at position ___. (a) 2 (b) 1 (c) 10 (d) 0
- 26.True or false: the sound on/off setting fits saving in the cloud. (a) True (b) False
- 27.Which of these fits saving in the cloud? (a) the sound on/off setting (b) photos on two devices (c) notes to read offline (d) your last game level
-
28.💾 What does this code show? (Positions start at 0.)
let friends = ["Zoya", "Riya", "Kabir", "Arjun"];
show(friends[0]); (a) Kabir (b) Riya (c) Arjun (d) Zoya -
29.💾 What does this code show? (Positions start at 0.)
let songs = ["Ocean", "Kites", "Sunrise", "Stars", "Rain"];
show(songs[4]); (a) Kites (b) Ocean (c) Rain (d) Sunrise -
30.💾 What number does this code show?
let score = 5;
score = score - 3;
score = score + 4;
show(score); -
31.💾 pop() takes off the last item. What does this code show?
let songs = ["Monsoon", "Rain", "Sunrise", "Kites"];
songs.pop();
show(songs[songs.length - 1]); (a) Rain (b) Sunrise (c) Kites (d) Monsoon - 32.Which of these fits saving on the phone? (a) a shared to-do list (b) chat messages to friends (c) notes to read offline (d) a class leaderboard
-
33.💾 pop() takes off the last item. What does this code show?
let notes = ["Sports", "Maths", "Science", "Music"];
notes.pop();
show(notes[notes.length - 1]); (a) Sports (b) Maths (c) Music (d) Science -
34.💾 pop() takes off the last item. What does this code show?
let songs = ["Monsoon", "Stars", "Ocean"];
songs.pop();
show(songs[songs.length - 1]); (a) Stars (b) Monsoon (c) Ocean - 35.True or false: a class leaderboard fits saving on the phone. (a) False (b) True
-
36.💾 What number does this code show?
let coins = 7;
coins = coins - 6;
coins = coins + 2;
show(coins); - 37.True or false: chat messages to friends fits saving on the phone. (a) True (b) False
-
38.💾 What number does this code show?
let friends = ["Arjun", "Riya", "Zoya", "Aman"];
friends.push("Kabir");
show(friends.length); - 39.Which of these fits saving in the cloud? (a) a class leaderboard (b) your last game level (c) a draft you are typing (d) notes to read offline
-
40.💾 What number does this code show?
let stars = 5;
stars = stars - 3;
stars = stars + 1;
show(stars);
Answer key
- 3
- a list
- Sports
- chat messages to friends
- Science
- data saved on the phone
- False
- on the phone
- a shared to-do list
- in the cloud
- Maths
- True
- the sound on/off setting
- 4
- a named box for a value
- use it on any device
- on the phone
- 7
- False
- the phone is lost
- Monsoon
- Riya
- True
- 6
- 0
- False
- photos on two devices
- Zoya
- Rain
- 6
- Sunrise
- notes to read offline
- Science
- Stars
- False
- 3
- False
- 5
- a class leaderboard
- 3
Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students