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

Answer key

  1. on the phone
  2. True
  3. True
  4. False
  5. Music
  6. use it on any device
  7. Meera
  8. False
  9. a named box for a value
  10. on the phone
  11. Hindi
  12. False
  13. True
  14. 4
  15. Riya
  16. on the phone
  17. Rain
  18. 3
  19. Rain
  20. in the cloud
  21. Meera
  22. Sports
  23. False
  24. 5
  25. 3
  26. 2
  27. False
  28. 7
  29. chat messages to friends
  30. the sound on/off setting
  31. in the cloud
  32. Monsoon
  33. data saved on the phone
  34. 4
  35. 2
  36. Rain
  37. True
  38. a list
  39. 5
  40. on the phone

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