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

Answer key

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

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