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

Answer key

  1. data saved on the phone
  2. in the cloud
  3. a shared to-do list
  4. on the phone
  5. 7
  6. 5
  7. use it on any device
  8. True
  9. 9
  10. 8
  11. 4
  12. notes to read offline
  13. False
  14. Music
  15. on the phone
  16. True
  17. 5
  18. Music
  19. Monsoon
  20. a list
  21. 10
  22. a draft you are typing
  23. Ocean
  24. Ocean
  25. True
  26. 3
  27. Aman
  28. a named box for a value
  29. Riya
  30. on the phone
  31. 7
  32. Ocean
  33. True
  34. 5
  35. 5
  36. Music
  37. False
  38. 0
  39. in the cloud
  40. Science

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