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

Answer key

  1. 3
  2. True
  3. a shared to-do list
  4. 5
  5. 5
  6. 3
  7. 4
  8. in the cloud
  9. chat messages to friends
  10. 2
  11. False
  12. the phone is lost
  13. True
  14. 9
  15. 4
  16. on the phone
  17. Music
  18. Maths
  19. 6
  20. your last game level
  21. 5
  22. False
  23. Maths
  24. photos on two devices
  25. Monsoon
  26. on the phone
  27. Hindi
  28. Aman
  29. 4
  30. Arjun
  31. 0
  32. use it on any device
  33. Art
  34. Kites
  35. notes to read offline
  36. on the phone
  37. 4
  38. True
  39. Sports
  40. a draft you are typing

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