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