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

Answer key

  1. 5
  2. a shared to-do list
  3. use it on any device
  4. 3
  5. 4
  6. in the cloud
  7. 0
  8. Arjun
  9. Sports
  10. True
  11. 4
  12. Aman
  13. False
  14. a draft you are typing
  15. notes to read offline
  16. Maths
  17. False
  18. 11
  19. False
  20. Arjun
  21. False
  22. 2
  23. 3
  24. 2
  25. the phone is lost
  26. 6
  27. in the cloud
  28. a list
  29. a named box for a value
  30. chat messages to friends
  31. in the cloud
  32. Sunrise
  33. on the phone
  34. Hindi
  35. Maths
  36. False
  37. 4
  38. 6
  39. 3
  40. Music

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