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