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

Answer key

  1. on the phone
  2. Hindi
  3. True
  4. in the cloud
  5. Hindi
  6. 3
  7. Sports
  8. 3
  9. Monsoon
  10. False
  11. your last game level
  12. the sound on/off setting
  13. a shared to-do list
  14. False
  15. in the cloud
  16. False
  17. 5
  18. False
  19. 9
  20. Rain
  21. 10
  22. chat messages to friends
  23. 5
  24. a class leaderboard
  25. a list
  26. False
  27. in the cloud
  28. Music
  29. False
  30. Rain
  31. 3
  32. 5
  33. 3
  34. use it on any device
  35. the phone is lost
  36. a draft you are typing
  37. 0
  38. False
  39. 5
  40. on the phone

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