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

Answer key

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

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