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

Answer key

  1. the phone is lost
  2. in the cloud
  3. False
  4. Maths
  5. Ocean
  6. Ocean
  7. in the cloud
  8. 3
  9. a list
  10. on the phone
  11. a class leaderboard
  12. 9
  13. on the phone
  14. 0
  15. False
  16. in the cloud
  17. on the phone
  18. data saved on the phone
  19. Sports
  20. Art
  21. 8
  22. a named box for a value
  23. False
  24. Kabir
  25. 7
  26. in the cloud
  27. your last game level
  28. 5
  29. 5
  30. True
  31. True
  32. on the phone
  33. True
  34. chat messages to friends
  35. False
  36. use it on any device
  37. False
  38. 7
  39. 5
  40. 11

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