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