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