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

Answer key

  1. on the phone
  2. on the phone
  3. Hindi
  4. data saved on the phone
  5. True
  6. in the cloud
  7. True
  8. Hindi
  9. 3
  10. 5
  11. 6
  12. 5
  13. a class leaderboard
  14. chat messages to friends
  15. photos on two devices
  16. 5
  17. Music
  18. Maths
  19. 5
  20. Zoya
  21. a shared to-do list
  22. the phone is lost
  23. use it on any device
  24. 4
  25. in the cloud
  26. 2
  27. in the cloud
  28. 5
  29. 6
  30. Music
  31. Aman
  32. 5
  33. Zoya
  34. on the phone
  35. False
  36. 7
  37. notes to read offline
  38. Meera
  39. 5
  40. 6

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