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

Answer key

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

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