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

Answer key

  1. in the cloud
  2. False
  3. False
  4. False
  5. use it on any device
  6. 5
  7. a draft you are typing
  8. Maths
  9. in the cloud
  10. 4
  11. True
  12. chat messages to friends
  13. 3
  14. 7
  15. data saved on the phone
  16. Arjun
  17. Arjun
  18. in the cloud
  19. Music
  20. 6
  21. notes to read offline
  22. a shared to-do list
  23. in the cloud
  24. False
  25. 5
  26. 0
  27. 4
  28. Ocean
  29. 3
  30. 6
  31. Hindi
  32. Zoya
  33. Sunrise
  34. Art
  35. 4
  36. on the phone
  37. a list
  38. False
  39. your last game level
  40. on the phone

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