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

Answer key

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

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