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

Answer key

  1. use it on any device
  2. 5
  3. 4
  4. 1
  5. Kites
  6. False
  7. chat messages to friends
  8. on the phone
  9. 4
  10. True
  11. 4
  12. in the cloud
  13. 3
  14. data saved on the phone
  15. Hindi
  16. False
  17. on the phone
  18. a named box for a value
  19. Hindi
  20. 6
  21. your last game level
  22. Maths
  23. the sound on/off setting
  24. on the phone
  25. photos on two devices
  26. in the cloud
  27. False
  28. 3
  29. Meera
  30. 0
  31. the phone is lost
  32. in the cloud
  33. Monsoon
  34. Meera
  35. a class leaderboard
  36. Zoya
  37. 3
  38. 5
  39. Kites
  40. 4

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