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

Answer key

  1. on the phone
  2. use it on any device
  3. data saved on the phone
  4. True
  5. in the cloud
  6. 5
  7. a class leaderboard
  8. Art
  9. in the cloud
  10. on the phone
  11. 6
  12. 0
  13. your last game level
  14. Aman
  15. in the cloud
  16. 3
  17. the phone is lost
  18. notes to read offline
  19. chat messages to friends
  20. Art
  21. 5
  22. False
  23. Arjun
  24. 10
  25. 4
  26. Hindi
  27. on the phone
  28. on the phone
  29. a list
  30. Kabir
  31. a shared to-do list
  32. 5
  33. Maths
  34. 4
  35. 6
  36. Sports
  37. 5
  38. the sound on/off setting
  39. Art
  40. Hindi

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