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

Answer key

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

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