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

Answer key

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

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