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

Answer key

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

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