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

Answer key

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

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