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

Answer key

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

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