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

Answer key

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

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