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