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

Answer key

  1. Sports
  2. photos on two devices
  3. Music
  4. 11
  5. 2
  6. Science
  7. Music
  8. a class leaderboard
  9. a list
  10. data saved on the phone
  11. 4
  12. use it on any device
  13. in the cloud
  14. False
  15. 4
  16. the phone is lost
  17. 4
  18. on the phone
  19. Hindi
  20. Riya
  21. 4
  22. your last game level
  23. a named box for a value
  24. Science
  25. False
  26. Kabir
  27. False
  28. Sunrise
  29. 10
  30. on the phone
  31. notes to read offline
  32. the sound on/off setting
  33. True
  34. Arjun
  35. in the cloud
  36. 4
  37. Rain
  38. on the phone
  39. 2
  40. True

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