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