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

Answer key

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

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