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

Answer key

  1. Maths
  2. a draft you are typing
  3. in the cloud
  4. 5
  5. Stars
  6. use it on any device
  7. 6
  8. Science
  9. Hindi
  10. your last game level
  11. False
  12. in the cloud
  13. a named box for a value
  14. data saved on the phone
  15. 3
  16. chat messages to friends
  17. 4
  18. Sports
  19. Zoya
  20. Riya
  21. 5
  22. False
  23. 8
  24. Kabir
  25. in the cloud
  26. the phone is lost
  27. False
  28. Art
  29. 5
  30. True
  31. a list
  32. 5
  33. True
  34. 4
  35. Zoya
  36. 4
  37. Sports
  38. 5
  39. 5
  40. in the cloud

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