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

Answer key

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

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