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

Answer key

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

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