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

Answer key

  1. chat messages to friends
  2. notes to read offline
  3. on the phone
  4. Arjun
  5. a draft you are typing
  6. False
  7. the sound on/off setting
  8. Riya
  9. 6
  10. Sunrise
  11. False
  12. True
  13. 5
  14. in the cloud
  15. True
  16. in the cloud
  17. 3
  18. Meera
  19. 0
  20. 7
  21. Arjun
  22. a named box for a value
  23. in the cloud
  24. Ocean
  25. on the phone
  26. on the phone
  27. 5
  28. 4
  29. 4
  30. the phone is lost
  31. 4
  32. 8
  33. 3
  34. Kabir
  35. Ocean
  36. 6
  37. Sunrise
  38. data saved on the phone
  39. False
  40. 7

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