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