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