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

Answer key

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

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