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

Answer key

  1. in the cloud
  2. Rain
  3. True
  4. 4
  5. the phone is lost
  6. notes to read offline
  7. 1
  8. False
  9. False
  10. True
  11. True
  12. Art
  13. a draft you are typing
  14. a list
  15. Monsoon
  16. in the cloud
  17. in the cloud
  18. Music
  19. 5
  20. a class leaderboard
  21. 0
  22. 1
  23. False
  24. Music
  25. Ocean
  26. Sports
  27. Zoya
  28. on the phone
  29. Maths
  30. True
  31. False
  32. 5
  33. Kites
  34. Ocean
  35. use it on any device
  36. 5
  37. 3
  38. Zoya
  39. 9
  40. Monsoon

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