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

Answer key

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

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