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

Answer key

  1. False
  2. True
  3. 5
  4. 0
  5. 3
  6. in the cloud
  7. in the cloud
  8. notes to read offline
  9. Monsoon
  10. True
  11. your last game level
  12. data saved on the phone
  13. False
  14. on the phone
  15. Kabir
  16. Science
  17. Science
  18. 3
  19. a named box for a value
  20. Arjun
  21. the phone is lost
  22. chat messages to friends
  23. Kabir
  24. Sports
  25. False
  26. Riya
  27. 5
  28. Ocean
  29. in the cloud
  30. 5
  31. a shared to-do list
  32. 4
  33. in the cloud
  34. 7
  35. a list
  36. True
  37. Science
  38. True
  39. 5
  40. Music

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