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

Answer key

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

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