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