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

Answer key

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

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