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