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

Answer key

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

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