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