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