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

Answer key

  1. photos on two devices
  2. on the phone
  3. 4
  4. True
  5. Aman
  6. 6
  7. 0
  8. a named box for a value
  9. Monsoon
  10. a list
  11. True
  12. in the cloud
  13. on the phone
  14. 6
  15. 10
  16. False
  17. True
  18. 3
  19. Hindi
  20. False
  21. True
  22. chat messages to friends
  23. 6
  24. True
  25. 4
  26. your last game level
  27. in the cloud
  28. 7
  29. Sports
  30. Ocean
  31. 6
  32. Meera
  33. 5
  34. Kabir
  35. Art
  36. False
  37. 6
  38. False
  39. on the phone
  40. use it on any device

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