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