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