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