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

Answer key

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

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