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