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

Answer key

  1. Meera
  2. Science
  3. a draft you are typing
  4. 5
  5. False
  6. Sports
  7. 3
  8. True
  9. notes to read offline
  10. the sound on/off setting
  11. use it on any device
  12. False
  13. Hindi
  14. data saved on the phone
  15. True
  16. Meera
  17. on the phone
  18. a class leaderboard
  19. Sports
  20. on the phone
  21. Hindi
  22. Aman
  23. a shared to-do list
  24. a named box for a value
  25. 4
  26. True
  27. 6
  28. 4
  29. Riya
  30. Stars
  31. Hindi
  32. your last game level
  33. False
  34. 4
  35. Science
  36. photos on two devices
  37. 9
  38. Zoya
  39. 3
  40. Ocean

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