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

Answer key

  1. False
  2. Sports
  3. True
  4. Sunrise
  5. 4
  6. True
  7. Art
  8. in the cloud
  9. on the phone
  10. 5
  11. use it on any device
  12. on the phone
  13. True
  14. False
  15. 9
  16. a list
  17. Maths
  18. Rain
  19. 5
  20. a draft you are typing
  21. 3
  22. 6
  23. False
  24. a shared to-do list
  25. 6
  26. 4
  27. a named box for a value
  28. the sound on/off setting
  29. 7
  30. Maths
  31. Sports
  32. Rain
  33. Rain
  34. 4
  35. Kabir
  36. in the cloud
  37. 6
  38. in the cloud
  39. chat messages to friends
  40. False

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