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