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

Answer key

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

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