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

Answer key

  1. in the cloud
  2. notes to read offline
  3. 8
  4. Zoya
  5. a draft you are typing
  6. chat messages to friends
  7. False
  8. False
  9. on the phone
  10. a list
  11. Sunrise
  12. on the phone
  13. Aman
  14. 6
  15. 7
  16. on the phone
  17. False
  18. True
  19. data saved on the phone
  20. 5
  21. Monsoon
  22. 3
  23. use it on any device
  24. Riya
  25. Zoya
  26. Ocean
  27. 4
  28. in the cloud
  29. False
  30. a named box for a value
  31. Science
  32. Science
  33. the phone is lost
  34. 0
  35. False
  36. Zoya
  37. True
  38. Meera
  39. True
  40. 5

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