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