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

Answer key

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

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