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

Answer key

  1. Kites
  2. a class leaderboard
  3. False
  4. False
  5. True
  6. False
  7. Kabir
  8. Rain
  9. notes to read offline
  10. 5
  11. Hindi
  12. Zoya
  13. chat messages to friends
  14. Sports
  15. the phone is lost
  16. False
  17. use it on any device
  18. 4
  19. a list
  20. a named box for a value
  21. Riya
  22. a shared to-do list
  23. in the cloud
  24. Zoya
  25. in the cloud
  26. in the cloud
  27. photos on two devices
  28. on the phone
  29. Monsoon
  30. False
  31. Kabir
  32. on the phone
  33. 5
  34. 5
  35. 4
  36. Sunrise
  37. 6
  38. the sound on/off setting
  39. in the cloud
  40. Meera

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