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

Answer key

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

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