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

Answer key

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

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