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

Answer key

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

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