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

Answer key

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

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