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

Answer key

  1. 3
  2. 5
  3. in the cloud
  4. a named box for a value
  5. 4
  6. on the phone
  7. 4
  8. on the phone
  9. on the phone
  10. 5
  11. the sound on/off setting
  12. Riya
  13. in the cloud
  14. 6
  15. True
  16. Science
  17. False
  18. 0
  19. True
  20. 2
  21. 4
  22. 3
  23. Hindi
  24. 2
  25. a class leaderboard
  26. Maths
  27. True
  28. Kabir
  29. a draft you are typing
  30. data saved on the phone
  31. False
  32. on the phone
  33. False
  34. 3
  35. use it on any device
  36. 5
  37. 5
  38. 5
  39. False
  40. 5

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