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

Answer key

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

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