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