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

Answer key

  1. in the cloud
  2. on the phone
  3. Ocean
  4. False
  5. 3
  6. a list
  7. False
  8. False
  9. True
  10. 8
  11. Aman
  12. a named box for a value
  13. 4
  14. 6
  15. Arjun
  16. a class leaderboard
  17. 3
  18. in the cloud
  19. 4
  20. False
  21. chat messages to friends
  22. use it on any device
  23. False
  24. 6
  25. Sports
  26. Sports
  27. 5
  28. 6
  29. False
  30. Hindi
  31. Riya
  32. 6
  33. in the cloud
  34. 6
  35. Art
  36. data saved on the phone
  37. Aman
  38. Music
  39. 3
  40. on the phone

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