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

Answer key

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

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