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

Answer key

  1. data saved on the phone
  2. True
  3. in the cloud
  4. 0
  5. 3
  6. on the phone
  7. Riya
  8. 6
  9. your last game level
  10. True
  11. a list
  12. 4
  13. 5
  14. in the cloud
  15. True
  16. chat messages to friends
  17. Kabir
  18. Kabir
  19. a named box for a value
  20. 5
  21. on the phone
  22. Ocean
  23. False
  24. False
  25. a shared to-do list
  26. 4
  27. in the cloud
  28. 9
  29. Rain
  30. 5
  31. 3
  32. Stars
  33. on the phone
  34. Kites
  35. 6
  36. Sunrise
  37. 3
  38. use it on any device
  39. Art
  40. Riya

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