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

Answer key

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

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