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