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