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

Answer key

  1. Maths
  2. False
  3. 0
  4. True
  5. a named box for a value
  6. a draft you are typing
  7. False
  8. data saved on the phone
  9. a shared to-do list
  10. Kites
  11. in the cloud
  12. a list
  13. True
  14. Rain
  15. Zoya
  16. Meera
  17. True
  18. in the cloud
  19. a class leaderboard
  20. 6
  21. 4
  22. on the phone
  23. 9
  24. 5
  25. True
  26. True
  27. True
  28. False
  29. False
  30. 3
  31. Sunrise
  32. 3
  33. 9
  34. in the cloud
  35. notes to read offline
  36. on the phone
  37. 5
  38. 5
  39. 2
  40. the sound on/off setting

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