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

Answer key

  1. 3
  2. 11
  3. 3
  4. Aman
  5. 5
  6. data saved on the phone
  7. use it on any device
  8. Sports
  9. Hindi
  10. 0
  11. 5
  12. chat messages to friends
  13. a list
  14. 4
  15. in the cloud
  16. 9
  17. Stars
  18. Stars
  19. 5
  20. True
  21. on the phone
  22. 3
  23. False
  24. 4
  25. False
  26. 2
  27. 3
  28. a draft you are typing
  29. photos on two devices
  30. Arjun
  31. the phone is lost
  32. True
  33. 3
  34. 4
  35. Art
  36. Rain
  37. in the cloud
  38. 1
  39. 7
  40. False

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