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