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