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

Answer key

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

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