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

Answer key

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

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