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

Answer key

  1. True
  2. a named box for a value
  3. 4
  4. in the cloud
  5. the sound on/off setting
  6. Hindi
  7. Monsoon
  8. True
  9. a draft you are typing
  10. chat messages to friends
  11. 4
  12. False
  13. on the phone
  14. 7
  15. False
  16. Zoya
  17. False
  18. False
  19. data saved on the phone
  20. Arjun
  21. False
  22. 8
  23. True
  24. 3
  25. in the cloud
  26. 3
  27. 3
  28. 0
  29. 7
  30. Hindi
  31. False
  32. in the cloud
  33. Science
  34. 4
  35. your last game level
  36. use it on any device
  37. 3
  38. Science
  39. True
  40. Kabir

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