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

Answer key

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

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