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

Answer key

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

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