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