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

Answer key

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

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