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

Answer key

  1. on the phone
  2. False
  3. Arjun
  4. on the phone
  5. False
  6. photos on two devices
  7. in the cloud
  8. a list
  9. False
  10. data saved on the phone
  11. on the phone
  12. the phone is lost
  13. Sports
  14. Zoya
  15. on the phone
  16. 4
  17. 10
  18. False
  19. True
  20. Science
  21. 4
  22. 1
  23. a shared to-do list
  24. Sports
  25. Meera
  26. 0
  27. Sunrise
  28. Zoya
  29. use it on any device
  30. 3
  31. 5
  32. 4
  33. Aman
  34. Music
  35. Hindi
  36. in the cloud
  37. in the cloud
  38. a class leaderboard
  39. 3
  40. your last game level

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