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

Answer key

  1. your last game level
  2. Sports
  3. on the phone
  4. 5
  5. in the cloud
  6. a named box for a value
  7. False
  8. 5
  9. 3
  10. the phone is lost
  11. 4
  12. Zoya
  13. in the cloud
  14. 4
  15. Monsoon
  16. in the cloud
  17. False
  18. 3
  19. in the cloud
  20. the sound on/off setting
  21. 3
  22. False
  23. 0
  24. 10
  25. False
  26. 6
  27. Art
  28. 6
  29. True
  30. True
  31. True
  32. 5
  33. a class leaderboard
  34. Arjun
  35. Sports
  36. 7
  37. Sports
  38. 5
  39. Rain
  40. True

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