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

Answer key

  1. True
  2. Meera
  3. data saved on the phone
  4. 6
  5. on the phone
  6. 5
  7. in the cloud
  8. 1
  9. False
  10. False
  11. a draft you are typing
  12. Arjun
  13. on the phone
  14. in the cloud
  15. on the phone
  16. 6
  17. 10
  18. 6
  19. notes to read offline
  20. use it on any device
  21. Zoya
  22. 9
  23. 5
  24. False
  25. Arjun
  26. in the cloud
  27. Arjun
  28. Monsoon
  29. a named box for a value
  30. 3
  31. 10
  32. 8
  33. chat messages to friends
  34. Kites
  35. False
  36. on the phone
  37. in the cloud
  38. 0
  39. Rain
  40. Sports

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