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

Answer key

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

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