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

Answer key

  1. on the phone
  2. 5
  3. Maths
  4. 5
  5. True
  6. Sunrise
  7. a class leaderboard
  8. a list
  9. 3
  10. in the cloud
  11. False
  12. True
  13. on the phone
  14. 5
  15. in the cloud
  16. Maths
  17. 5
  18. Zoya
  19. 2
  20. Hindi
  21. a shared to-do list
  22. a draft you are typing
  23. Monsoon
  24. on the phone
  25. Sports
  26. use it on any device
  27. 11
  28. on the phone
  29. Hindi
  30. True
  31. the phone is lost
  32. 0
  33. Sports
  34. in the cloud
  35. True
  36. the sound on/off setting
  37. 9
  38. Science
  39. 2
  40. Zoya

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