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