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

Answer key

  1. True
  2. in the cloud
  3. Maths
  4. on the phone
  5. in the cloud
  6. chat messages to friends
  7. Music
  8. in the cloud
  9. False
  10. 3
  11. True
  12. 5
  13. the sound on/off setting
  14. 5
  15. 3
  16. 0
  17. 4
  18. 3
  19. a named box for a value
  20. notes to read offline
  21. data saved on the phone
  22. a draft you are typing
  23. 4
  24. 4
  25. your last game level
  26. True
  27. 6
  28. Ocean
  29. 3
  30. 5
  31. on the phone
  32. False
  33. Science
  34. Kites
  35. 4
  36. 5
  37. 4
  38. Hindi
  39. on the phone
  40. 4

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