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

Answer key

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

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