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

Answer key

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

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