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

Answer key

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

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