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

Answer key

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

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