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