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

Answer key

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

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