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

Answer key

  1. in the cloud
  2. on the phone
  3. 3
  4. 5
  5. False
  6. False
  7. Hindi
  8. 5
  9. Music
  10. in the cloud
  11. Arjun
  12. on the phone
  13. the phone is lost
  14. True
  15. Riya
  16. 4
  17. a list
  18. False
  19. the sound on/off setting
  20. True
  21. a named box for a value
  22. data saved on the phone
  23. 6
  24. Music
  25. 2
  26. Sports
  27. 3
  28. use it on any device
  29. Rain
  30. photos on two devices
  31. a class leaderboard
  32. in the cloud
  33. 9
  34. a draft you are typing
  35. Meera
  36. on the phone
  37. 5
  38. 3
  39. False
  40. Riya

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