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