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