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

Answer key

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

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