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

Answer key

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

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