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

Answer key

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

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