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

Answer key

  1. 5
  2. False
  3. a class leaderboard
  4. 8
  5. 6
  6. use it on any device
  7. notes to read offline
  8. False
  9. 0
  10. True
  11. 6
  12. 4
  13. True
  14. Zoya
  15. on the phone
  16. False
  17. photos on two devices
  18. Rain
  19. Hindi
  20. a draft you are typing
  21. your last game level
  22. 4
  23. 5
  24. in the cloud
  25. Sports
  26. False
  27. on the phone
  28. True
  29. on the phone
  30. a named box for a value
  31. Music
  32. 3
  33. 5
  34. a list
  35. Hindi
  36. in the cloud
  37. False
  38. the phone is lost
  39. 6
  40. False

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