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

Answer key

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

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