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

Answer key

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

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