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

Answer key

  1. False
  2. data saved on the phone
  3. use it on any device
  4. in the cloud
  5. your last game level
  6. False
  7. False
  8. the phone is lost
  9. the sound on/off setting
  10. in the cloud
  11. a list
  12. True
  13. on the phone
  14. chat messages to friends
  15. 3
  16. a named box for a value
  17. 6
  18. notes to read offline
  19. 5
  20. Aman
  21. Rain
  22. on the phone
  23. 5
  24. Hindi
  25. 1
  26. 4
  27. Kabir
  28. 5
  29. Rain
  30. 3
  31. False
  32. 4
  33. Aman
  34. on the phone
  35. photos on two devices
  36. a draft you are typing
  37. Hindi
  38. Art
  39. Music
  40. 4

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