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