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

Answer key

  1. a list
  2. the sound on/off setting
  3. 4
  4. the phone is lost
  5. Monsoon
  6. in the cloud
  7. in the cloud
  8. in the cloud
  9. Aman
  10. True
  11. a class leaderboard
  12. use it on any device
  13. Art
  14. 5
  15. 3
  16. Art
  17. False
  18. 1
  19. 3
  20. on the phone
  21. Arjun
  22. Riya
  23. Art
  24. Riya
  25. 6
  26. Art
  27. 4
  28. True
  29. in the cloud
  30. a shared to-do list
  31. True
  32. 8
  33. False
  34. False
  35. data saved on the phone
  36. 3
  37. your last game level
  38. True
  39. False
  40. 4

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