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

Answer key

  1. False
  2. 0
  3. 5
  4. a class leaderboard
  5. on the phone
  6. use it on any device
  7. Aman
  8. on the phone
  9. True
  10. True
  11. in the cloud
  12. 3
  13. True
  14. on the phone
  15. in the cloud
  16. a named box for a value
  17. 4
  18. 2
  19. the phone is lost
  20. Science
  21. your last game level
  22. on the phone
  23. Aman
  24. 6
  25. in the cloud
  26. True
  27. 4
  28. Zoya
  29. Sunrise
  30. Music
  31. a list
  32. Music
  33. notes to read offline
  34. Kites
  35. Ocean
  36. 5
  37. Ocean
  38. in the cloud
  39. 5
  40. 4

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