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

Answer key

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

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