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

Answer key

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

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