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

Answer key

  1. Aman
  2. True
  3. on the phone
  4. 10
  5. on the phone
  6. a draft you are typing
  7. 11
  8. Meera
  9. 5
  10. on the phone
  11. True
  12. 6
  13. Maths
  14. False
  15. Sunrise
  16. 2
  17. photos on two devices
  18. Sunrise
  19. a list
  20. a shared to-do list
  21. Riya
  22. notes to read offline
  23. 4
  24. a named box for a value
  25. True
  26. 1
  27. on the phone
  28. False
  29. in the cloud
  30. data saved on the phone
  31. 0
  32. True
  33. Maths
  34. False
  35. a class leaderboard
  36. 6
  37. chat messages to friends
  38. False
  39. Arjun
  40. Monsoon

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