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