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

Answer key

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

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