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