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

Answer key

  1. 3
  2. a list
  3. Sports
  4. chat messages to friends
  5. Science
  6. data saved on the phone
  7. False
  8. on the phone
  9. a shared to-do list
  10. in the cloud
  11. Maths
  12. True
  13. the sound on/off setting
  14. 4
  15. a named box for a value
  16. use it on any device
  17. on the phone
  18. 7
  19. False
  20. the phone is lost
  21. Monsoon
  22. Riya
  23. True
  24. 6
  25. 0
  26. False
  27. photos on two devices
  28. Zoya
  29. Rain
  30. 6
  31. Sunrise
  32. notes to read offline
  33. Science
  34. Stars
  35. False
  36. 3
  37. False
  38. 5
  39. a class leaderboard
  40. 3

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