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