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

Answer key

  1. in the cloud
  2. False
  3. 3
  4. Aman
  5. a shared to-do list
  6. 7
  7. Art
  8. a list
  9. on the phone
  10. 3
  11. data saved on the phone
  12. on the phone
  13. Maths
  14. False
  15. Ocean
  16. on the phone
  17. in the cloud
  18. 6
  19. 3
  20. False
  21. 0
  22. a named box for a value
  23. a draft you are typing
  24. True
  25. the phone is lost
  26. 4
  27. 6
  28. Rain
  29. use it on any device
  30. False
  31. 3
  32. True
  33. 3
  34. 9
  35. Meera
  36. Sunrise
  37. 6
  38. Stars
  39. Sunrise
  40. your last game level

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