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

Answer key

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

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