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

Answer key

  1. chat messages to friends
  2. Sunrise
  3. False
  4. False
  5. Zoya
  6. on the phone
  7. Music
  8. 8
  9. Zoya
  10. True
  11. in the cloud
  12. on the phone
  13. a shared to-do list
  14. 4
  15. Rain
  16. the phone is lost
  17. Ocean
  18. False
  19. 3
  20. use it on any device
  21. 6
  22. 5
  23. a named box for a value
  24. a class leaderboard
  25. False
  26. 3
  27. a list
  28. a draft you are typing
  29. 2
  30. on the phone
  31. notes to read offline
  32. Sunrise
  33. 7
  34. 0
  35. 11
  36. 6
  37. Stars
  38. Maths
  39. photos on two devices
  40. 5

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