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

Answer key

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

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