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

Answer key

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

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