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

Answer key

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

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