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