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