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

Answer key

  1. False
  2. 0
  3. Hindi
  4. Science
  5. in the cloud
  6. a list
  7. False
  8. False
  9. 4
  10. notes to read offline
  11. Stars
  12. on the phone
  13. False
  14. True
  15. Riya
  16. a named box for a value
  17. chat messages to friends
  18. on the phone
  19. a draft you are typing
  20. Aman
  21. Aman
  22. 4
  23. True
  24. True
  25. in the cloud
  26. 5
  27. Monsoon
  28. 8
  29. False
  30. 6
  31. Rain
  32. the sound on/off setting
  33. 6
  34. 5
  35. a class leaderboard
  36. 5
  37. 6
  38. 4
  39. Maths
  40. the phone is lost

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