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

Answer key

  1. True
  2. 6
  3. 4
  4. the phone is lost
  5. False
  6. Kites
  7. use it on any device
  8. 7
  9. Science
  10. in the cloud
  11. True
  12. Kabir
  13. False
  14. 1
  15. 4
  16. Hindi
  17. False
  18. 4
  19. True
  20. Riya
  21. 3
  22. 6
  23. Riya
  24. False
  25. True
  26. Sports
  27. notes to read offline
  28. a draft you are typing
  29. False
  30. data saved on the phone
  31. your last game level
  32. 6
  33. 2
  34. True
  35. in the cloud
  36. a named box for a value
  37. 8
  38. False
  39. photos on two devices
  40. True

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