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