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

Answer key

  1. False
  2. use it on any device
  3. Sports
  4. a shared to-do list
  5. 7
  6. 3
  7. your last game level
  8. the sound on/off setting
  9. a draft you are typing
  10. in the cloud
  11. data saved on the phone
  12. Ocean
  13. 8
  14. the phone is lost
  15. on the phone
  16. Meera
  17. 7
  18. 3
  19. on the phone
  20. 3
  21. a class leaderboard
  22. Music
  23. 9
  24. False
  25. False
  26. 3
  27. in the cloud
  28. True
  29. chat messages to friends
  30. True
  31. 5
  32. Rain
  33. Maths
  34. 7
  35. 1
  36. 3
  37. 5
  38. 5
  39. Meera
  40. in the cloud

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