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

Answer key

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

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