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

Answer key

  1. False
  2. data saved on the phone
  3. Kites
  4. use it on any device
  5. Meera
  6. True
  7. a named box for a value
  8. on the phone
  9. a list
  10. 5
  11. Sports
  12. True
  13. 6
  14. Stars
  15. Sports
  16. the phone is lost
  17. 3
  18. 4
  19. Meera
  20. in the cloud
  21. Kites
  22. True
  23. 5
  24. Music
  25. in the cloud
  26. your last game level
  27. in the cloud
  28. a draft you are typing
  29. False
  30. 5
  31. 1
  32. in the cloud
  33. True
  34. False
  35. 7
  36. 4
  37. 1
  38. 4
  39. 0
  40. Zoya

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