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

Answer key

  1. in the cloud
  2. in the cloud
  3. in the cloud
  4. 3
  5. False
  6. True
  7. False
  8. True
  9. notes to read offline
  10. a list
  11. 0
  12. on the phone
  13. use it on any device
  14. Sports
  15. Sports
  16. a named box for a value
  17. 4
  18. chat messages to friends
  19. a draft you are typing
  20. 6
  21. Art
  22. Meera
  23. the sound on/off setting
  24. True
  25. Kabir
  26. a class leaderboard
  27. 4
  28. a shared to-do list
  29. Maths
  30. 3
  31. True
  32. your last game level
  33. 4
  34. 5
  35. photos on two devices
  36. Music
  37. Riya
  38. the phone is lost
  39. 9
  40. data saved on the phone

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