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

Answer key

  1. data saved on the phone
  2. Maths
  3. the sound on/off setting
  4. a draft you are typing
  5. False
  6. in the cloud
  7. in the cloud
  8. 6
  9. Rain
  10. True
  11. 8
  12. on the phone
  13. photos on two devices
  14. Ocean
  15. True
  16. 6
  17. 0
  18. Riya
  19. 5
  20. True
  21. 4
  22. 4
  23. False
  24. True
  25. 6
  26. False
  27. 5
  28. 4
  29. True
  30. your last game level
  31. 9
  32. on the phone
  33. Art
  34. Aman
  35. 5
  36. a shared to-do list
  37. 5
  38. a list
  39. Kites
  40. the phone is lost

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