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

Answer key

  1. in the cloud
  2. notes to read offline
  3. True
  4. 5
  5. True
  6. chat messages to friends
  7. a class leaderboard
  8. Zoya
  9. a list
  10. a named box for a value
  11. 5
  12. in the cloud
  13. Riya
  14. Kabir
  15. Sports
  16. Kabir
  17. True
  18. Arjun
  19. in the cloud
  20. False
  21. False
  22. 5
  23. use it on any device
  24. 7
  25. on the phone
  26. Sunrise
  27. 6
  28. 4
  29. Maths
  30. 3
  31. True
  32. on the phone
  33. on the phone
  34. True
  35. False
  36. Maths
  37. False
  38. Music
  39. Riya
  40. Zoya

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