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