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