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

Answer key

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

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