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