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