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