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

Answer key

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

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