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