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

Answer key

  1. chat messages to friends
  2. 5
  3. True
  4. 4
  5. notes to read offline
  6. a draft you are typing
  7. False
  8. 2
  9. False
  10. 6
  11. the sound on/off setting
  12. 8
  13. Music
  14. Hindi
  15. your last game level
  16. False
  17. on the phone
  18. on the phone
  19. 4
  20. 5
  21. in the cloud
  22. False
  23. 6
  24. Zoya
  25. on the phone
  26. use it on any device
  27. Science
  28. Meera
  29. photos on two devices
  30. 7
  31. 4
  32. True
  33. Stars
  34. Monsoon
  35. 0
  36. a class leaderboard
  37. in the cloud
  38. Monsoon
  39. 3
  40. 5

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