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

Answer key

  1. False
  2. on the phone
  3. 5
  4. 3
  5. True
  6. on the phone
  7. Art
  8. 0
  9. in the cloud
  10. on the phone
  11. False
  12. True
  13. the phone is lost
  14. a list
  15. Ocean
  16. Meera
  17. False
  18. a named box for a value
  19. Arjun
  20. 2
  21. on the phone
  22. in the cloud
  23. True
  24. a draft you are typing
  25. False
  26. in the cloud
  27. the sound on/off setting
  28. 3
  29. data saved on the phone
  30. Music
  31. 5
  32. Aman
  33. photos on two devices
  34. 8
  35. Sunrise
  36. True
  37. a class leaderboard
  38. Zoya
  39. False
  40. 3

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