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

Answer key

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

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