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