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

Answer key

  1. 4
  2. on the phone
  3. a named box for a value
  4. 4
  5. Sports
  6. on the phone
  7. 3
  8. Rain
  9. 0
  10. Ocean
  11. Music
  12. chat messages to friends
  13. False
  14. False
  15. Stars
  16. True
  17. a list
  18. Art
  19. on the phone
  20. the sound on/off setting
  21. True
  22. 5
  23. 4
  24. True
  25. Music
  26. 7
  27. notes to read offline
  28. a draft you are typing
  29. a class leaderboard
  30. in the cloud
  31. your last game level
  32. 1
  33. 3
  34. Aman
  35. data saved on the phone
  36. True
  37. 4
  38. 2
  39. True
  40. the phone is lost

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