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

Answer key

  1. False
  2. data saved on the phone
  3. 3
  4. Kabir
  5. False
  6. 11
  7. in the cloud
  8. on the phone
  9. Art
  10. Rain
  11. 5
  12. a shared to-do list
  13. 5
  14. use it on any device
  15. True
  16. False
  17. 3
  18. the phone is lost
  19. Science
  20. 9
  21. True
  22. 3
  23. 4
  24. chat messages to friends
  25. Sunrise
  26. 4
  27. 4
  28. 4
  29. Sports
  30. a list
  31. Maths
  32. a class leaderboard
  33. 4
  34. 4
  35. 0
  36. on the phone
  37. 3
  38. on the phone
  39. 6
  40. 4

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