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

Answer key

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

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