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

Answer key

  1. Art
  2. Meera
  3. Arjun
  4. notes to read offline
  5. Sunrise
  6. on the phone
  7. your last game level
  8. in the cloud
  9. 4
  10. True
  11. 7
  12. in the cloud
  13. on the phone
  14. True
  15. True
  16. a named box for a value
  17. a draft you are typing
  18. 0
  19. a list
  20. False
  21. 4
  22. 6
  23. False
  24. 8
  25. 5
  26. Art
  27. data saved on the phone
  28. 3
  29. Sports
  30. Kabir
  31. 6
  32. in the cloud
  33. 4
  34. 6
  35. Monsoon
  36. on the phone
  37. Meera
  38. the phone is lost
  39. True
  40. in the cloud

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