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

Answer key

  1. Science
  2. on the phone
  3. 4
  4. Music
  5. photos on two devices
  6. 0
  7. on the phone
  8. False
  9. 8
  10. on the phone
  11. 3
  12. Riya
  13. on the phone
  14. in the cloud
  15. True
  16. 8
  17. chat messages to friends
  18. Sports
  19. True
  20. in the cloud
  21. Stars
  22. True
  23. a class leaderboard
  24. Hindi
  25. False
  26. False
  27. Sunrise
  28. True
  29. a draft you are typing
  30. Science
  31. the sound on/off setting
  32. True
  33. in the cloud
  34. 5
  35. Riya
  36. 6
  37. 8
  38. data saved on the phone
  39. use it on any device
  40. 4

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