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

Answer key

  1. notes to read offline
  2. use it on any device
  3. 3
  4. Maths
  5. 6
  6. True
  7. in the cloud
  8. True
  9. chat messages to friends
  10. on the phone
  11. 7
  12. the sound on/off setting
  13. photos on two devices
  14. False
  15. 4
  16. False
  17. 3
  18. 6
  19. Arjun
  20. Arjun
  21. Stars
  22. on the phone
  23. Sports
  24. a list
  25. a shared to-do list
  26. a class leaderboard
  27. in the cloud
  28. 4
  29. 3
  30. Sports
  31. in the cloud
  32. data saved on the phone
  33. Kites
  34. 5
  35. Sports
  36. Ocean
  37. True
  38. 4
  39. Science
  40. False

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