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