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

Answer key

  1. False
  2. 3
  3. 4
  4. Meera
  5. True
  6. a class leaderboard
  7. data saved on the phone
  8. on the phone
  9. Maths
  10. False
  11. notes to read offline
  12. Maths
  13. the sound on/off setting
  14. on the phone
  15. a shared to-do list
  16. False
  17. on the phone
  18. 4
  19. True
  20. 5
  21. Arjun
  22. 3
  23. 5
  24. 3
  25. 4
  26. Stars
  27. in the cloud
  28. on the phone
  29. 8
  30. 9
  31. a list
  32. False
  33. in the cloud
  34. 4
  35. 4
  36. 5
  37. True
  38. the phone is lost
  39. 0
  40. False

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