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

Answer key

  1. False
  2. Maths
  3. True
  4. in the cloud
  5. photos on two devices
  6. Science
  7. False
  8. your last game level
  9. a draft you are typing
  10. True
  11. True
  12. 5
  13. Rain
  14. Stars
  15. a list
  16. on the phone
  17. 3
  18. the phone is lost
  19. Monsoon
  20. Maths
  21. notes to read offline
  22. 10
  23. 4
  24. 3
  25. 4
  26. 7
  27. Sunrise
  28. on the phone
  29. Music
  30. True
  31. 3
  32. in the cloud
  33. True
  34. 4
  35. chat messages to friends
  36. 5
  37. Music
  38. True
  39. on the phone
  40. 6

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