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

Answer key

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

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