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

Answer key

  1. True
  2. True
  3. 4
  4. 2
  5. in the cloud
  6. chat messages to friends
  7. Arjun
  8. 5
  9. 6
  10. on the phone
  11. in the cloud
  12. your last game level
  13. a named box for a value
  14. a shared to-do list
  15. 0
  16. False
  17. on the phone
  18. Monsoon
  19. a list
  20. Sports
  21. False
  22. 2
  23. 5
  24. False
  25. in the cloud
  26. notes to read offline
  27. False
  28. Monsoon
  29. Sports
  30. in the cloud
  31. False
  32. 4
  33. use it on any device
  34. Music
  35. a class leaderboard
  36. False
  37. 3
  38. 6
  39. 5
  40. the sound on/off setting

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