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