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

Answer key

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

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