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

Answer key

  1. True
  2. 8
  3. the sound on/off setting
  4. a list
  5. 3
  6. 5
  7. on the phone
  8. your last game level
  9. in the cloud
  10. chat messages to friends
  11. 4
  12. Art
  13. 6
  14. 7
  15. True
  16. the phone is lost
  17. Riya
  18. 6
  19. Stars
  20. on the phone
  21. a draft you are typing
  22. Meera
  23. a shared to-do list
  24. in the cloud
  25. 6
  26. in the cloud
  27. Maths
  28. True
  29. True
  30. True
  31. on the phone
  32. Sports
  33. Arjun
  34. False
  35. Kabir
  36. True
  37. Aman
  38. 7
  39. False
  40. Ocean

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