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

Answer key

  1. the sound on/off setting
  2. notes to read offline
  3. in the cloud
  4. True
  5. photos on two devices
  6. 4
  7. your last game level
  8. 5
  9. Riya
  10. 0
  11. True
  12. 10
  13. False
  14. Music
  15. Maths
  16. 5
  17. False
  18. on the phone
  19. 4
  20. True
  21. 6
  22. Monsoon
  23. on the phone
  24. 4
  25. False
  26. 5
  27. 6
  28. 5
  29. a named box for a value
  30. 5
  31. in the cloud
  32. a class leaderboard
  33. 3
  34. True
  35. a draft you are typing
  36. 6
  37. Ocean
  38. in the cloud
  39. 5
  40. in the cloud

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