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