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

Answer key

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

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