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

Answer key

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

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