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

Answer key

  1. the sound on/off setting
  2. 7
  3. Sunrise
  4. in the cloud
  5. 5
  6. in the cloud
  7. 8
  8. use it on any device
  9. Maths
  10. on the phone
  11. a named box for a value
  12. your last game level
  13. 4
  14. Monsoon
  15. 0
  16. data saved on the phone
  17. notes to read offline
  18. Kites
  19. Meera
  20. Hindi
  21. Rain
  22. a class leaderboard
  23. 7
  24. False
  25. 4
  26. Science
  27. 5
  28. on the phone
  29. a list
  30. Sports
  31. on the phone
  32. False
  33. on the phone
  34. Aman
  35. 4
  36. Aman
  37. photos on two devices
  38. 5
  39. 11
  40. Sunrise

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