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

Answer key

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

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