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

Answer key

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

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