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

Answer key

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

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