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

Answer key

  1. 5
  2. 0
  3. a list
  4. photos on two devices
  5. Stars
  6. True
  7. on the phone
  8. Sunrise
  9. a class leaderboard
  10. True
  11. 3
  12. in the cloud
  13. Hindi
  14. on the phone
  15. 4
  16. 5
  17. use it on any device
  18. Aman
  19. Hindi
  20. 9
  21. your last game level
  22. Stars
  23. True
  24. Arjun
  25. on the phone
  26. 4
  27. in the cloud
  28. 6
  29. Kabir
  30. Aman
  31. notes to read offline
  32. Hindi
  33. Aman
  34. Art
  35. Rain
  36. Zoya
  37. a draft you are typing
  38. 3
  39. 4
  40. False

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