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

Answer key

  1. data saved on the phone
  2. on the phone
  3. a list
  4. False
  5. 4
  6. False
  7. your last game level
  8. False
  9. the phone is lost
  10. 4
  11. the sound on/off setting
  12. 4
  13. True
  14. notes to read offline
  15. 6
  16. in the cloud
  17. in the cloud
  18. True
  19. on the phone
  20. 0
  21. False
  22. 10
  23. on the phone
  24. a class leaderboard
  25. True
  26. 2
  27. Zoya
  28. Hindi
  29. 8
  30. chat messages to friends
  31. Riya
  32. 3
  33. Arjun
  34. Zoya
  35. False
  36. a named box for a value
  37. Ocean
  38. on the phone
  39. 4
  40. 5

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