← Data: variables, lists and saving lesson New set →

App Dev Worksheet: Variables, Lists and Saving

App development lesson 15: Data: variables, lists and saving · Set 183 · 40 questions
TalentJR

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

Answer key

  1. 8
  2. Music
  3. False
  4. the sound on/off setting
  5. True
  6. 6
  7. False
  8. False
  9. 3
  10. Meera
  11. notes to read offline
  12. 4
  13. 5
  14. 5
  15. Kabir
  16. False
  17. 4
  18. Zoya
  19. 4
  20. in the cloud
  21. chat messages to friends
  22. False
  23. a list
  24. 3
  25. False
  26. 8
  27. the phone is lost
  28. a named box for a value
  29. on the phone
  30. True
  31. photos on two devices
  32. in the cloud
  33. Maths
  34. 5
  35. on the phone
  36. Hindi
  37. True
  38. your last game level
  39. 4
  40. 5

Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students