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

Answer key

  1. use it on any device
  2. 6
  3. a class leaderboard
  4. 6
  5. True
  6. the phone is lost
  7. a named box for a value
  8. on the phone
  9. notes to read offline
  10. 5
  11. Stars
  12. False
  13. 4
  14. Maths
  15. True
  16. in the cloud
  17. Sunrise
  18. Hindi
  19. 5
  20. Monsoon
  21. the sound on/off setting
  22. 5
  23. Stars
  24. Kites
  25. 11
  26. True
  27. 3
  28. Ocean
  29. Rain
  30. Music
  31. 5
  32. a shared to-do list
  33. a list
  34. Riya
  35. on the phone
  36. 3
  37. True
  38. 5
  39. 3
  40. False

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