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