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