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

Answer key

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

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