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

Answer key

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

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