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

Answer key

  1. your last game level
  2. Science
  3. the phone is lost
  4. a class leaderboard
  5. True
  6. data saved on the phone
  7. Sports
  8. the sound on/off setting
  9. False
  10. True
  11. Rain
  12. False
  13. Art
  14. 5
  15. Ocean
  16. on the phone
  17. Sports
  18. False
  19. 7
  20. Music
  21. Rain
  22. Sunrise
  23. True
  24. a shared to-do list
  25. Riya
  26. 8
  27. 5
  28. a list
  29. 6
  30. on the phone
  31. a named box for a value
  32. notes to read offline
  33. Hindi
  34. Stars
  35. 12
  36. in the cloud
  37. in the cloud
  38. 5
  39. a draft you are typing
  40. use it on any device

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