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

Answer key

  1. on the phone
  2. a draft you are typing
  3. chat messages to friends
  4. a named box for a value
  5. Science
  6. False
  7. False
  8. a shared to-do list
  9. data saved on the phone
  10. True
  11. 3
  12. notes to read offline
  13. False
  14. 4
  15. a list
  16. Maths
  17. Kabir
  18. 5
  19. True
  20. 6
  21. in the cloud
  22. Art
  23. 5
  24. Riya
  25. 2
  26. 4
  27. False
  28. 7
  29. Kabir
  30. False
  31. a class leaderboard
  32. Ocean
  33. Kabir
  34. on the phone
  35. 4
  36. Sports
  37. 2
  38. Maths
  39. Kites
  40. your last game level

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