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

Answer key

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

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