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