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

Answer key

  1. in the cloud
  2. a draft you are typing
  3. on the phone
  4. False
  5. 6
  6. 5
  7. Art
  8. use it on any device
  9. False
  10. Hindi
  11. your last game level
  12. a named box for a value
  13. 3
  14. the phone is lost
  15. in the cloud
  16. 3
  17. 5
  18. Music
  19. on the phone
  20. True
  21. Ocean
  22. 4
  23. data saved on the phone
  24. Sunrise
  25. 5
  26. chat messages to friends
  27. photos on two devices
  28. 8
  29. Art
  30. True
  31. Sunrise
  32. a shared to-do list
  33. a list
  34. 2
  35. 8
  36. Hindi
  37. True
  38. False
  39. Hindi
  40. False

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