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