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

Answer key

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

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