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

Answer key

  1. a named box for a value
  2. in the cloud
  3. in the cloud
  4. the phone is lost
  5. 10
  6. in the cloud
  7. 9
  8. on the phone
  9. 3
  10. on the phone
  11. Sports
  12. True
  13. False
  14. False
  15. a class leaderboard
  16. True
  17. False
  18. Arjun
  19. Science
  20. False
  21. notes to read offline
  22. a shared to-do list
  23. Aman
  24. on the phone
  25. 8
  26. True
  27. 4
  28. Kites
  29. Art
  30. in the cloud
  31. Meera
  32. Rain
  33. chat messages to friends
  34. True
  35. 8
  36. Sunrise
  37. 0
  38. 5
  39. 3
  40. a list

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