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

Answer key

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

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