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

Answer key

  1. the phone is lost
  2. Hindi
  3. Monsoon
  4. 8
  5. use it on any device
  6. True
  7. 1
  8. 4
  9. data saved on the phone
  10. Kabir
  11. True
  12. a class leaderboard
  13. 4
  14. True
  15. True
  16. 6
  17. 6
  18. 3
  19. 6
  20. the sound on/off setting
  21. 6
  22. in the cloud
  23. notes to read offline
  24. a list
  25. 5
  26. True
  27. Sports
  28. in the cloud
  29. Meera
  30. Ocean
  31. Maths
  32. Rain
  33. Stars
  34. on the phone
  35. Sunrise
  36. Rain
  37. 5
  38. Art
  39. your last game level
  40. a shared to-do list

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