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

Answer key

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

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