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

Answer key

  1. True
  2. use it on any device
  3. Art
  4. in the cloud
  5. 6
  6. a shared to-do list
  7. the phone is lost
  8. in the cloud
  9. False
  10. Zoya
  11. False
  12. False
  13. 3
  14. Kabir
  15. Arjun
  16. 5
  17. data saved on the phone
  18. True
  19. your last game level
  20. chat messages to friends
  21. a class leaderboard
  22. True
  23. False
  24. Aman
  25. Maths
  26. 7
  27. 2
  28. on the phone
  29. 2
  30. 4
  31. True
  32. 4
  33. True
  34. False
  35. a draft you are typing
  36. 5
  37. on the phone
  38. photos on two devices
  39. a list
  40. 4

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