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

Answer key

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

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