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