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

Answer key

  1. Music
  2. False
  3. your last game level
  4. Art
  5. False
  6. use it on any device
  7. Meera
  8. a list
  9. Ocean
  10. 0
  11. Maths
  12. the phone is lost
  13. Art
  14. on the phone
  15. Zoya
  16. in the cloud
  17. in the cloud
  18. 6
  19. in the cloud
  20. notes to read offline
  21. Science
  22. Arjun
  23. on the phone
  24. True
  25. data saved on the phone
  26. 4
  27. a named box for a value
  28. False
  29. Meera
  30. 2
  31. on the phone
  32. 3
  33. a shared to-do list
  34. 11
  35. on the phone
  36. a draft you are typing
  37. Hindi
  38. a class leaderboard
  39. 6
  40. 5

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