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

Answer key

  1. a named box for a value
  2. in the cloud
  3. True
  4. False
  5. chat messages to friends
  6. False
  7. False
  8. on the phone
  9. the phone is lost
  10. in the cloud
  11. notes to read offline
  12. a shared to-do list
  13. photos on two devices
  14. Kites
  15. a list
  16. 6
  17. 5
  18. a class leaderboard
  19. False
  20. on the phone
  21. Meera
  22. False
  23. 0
  24. True
  25. your last game level
  26. 3
  27. 3
  28. 4
  29. Ocean
  30. 5
  31. a draft you are typing
  32. 5
  33. 5
  34. True
  35. 4
  36. Sunrise
  37. Rain
  38. 5
  39. False
  40. data saved on the phone

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