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

Answer key

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

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