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