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