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

Answer key

  1. in the cloud
  2. 5
  3. True
  4. a named box for a value
  5. 6
  6. True
  7. on the phone
  8. 0
  9. 3
  10. False
  11. Ocean
  12. use it on any device
  13. Kabir
  14. photos on two devices
  15. False
  16. Arjun
  17. a shared to-do list
  18. Science
  19. Maths
  20. 5
  21. the sound on/off setting
  22. 3
  23. 1
  24. Meera
  25. a draft you are typing
  26. on the phone
  27. Ocean
  28. your last game level
  29. in the cloud
  30. 10
  31. notes to read offline
  32. Sunrise
  33. Riya
  34. False
  35. True
  36. 6
  37. False
  38. data saved on the phone
  39. chat messages to friends
  40. on the phone

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