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

Answer key

  1. 9
  2. a class leaderboard
  3. the phone is lost
  4. a named box for a value
  5. Sunrise
  6. 6
  7. Stars
  8. True
  9. Riya
  10. True
  11. Maths
  12. in the cloud
  13. data saved on the phone
  14. Hindi
  15. 6
  16. True
  17. 4
  18. a shared to-do list
  19. False
  20. a list
  21. Maths
  22. 4
  23. chat messages to friends
  24. 6
  25. Art
  26. 4
  27. in the cloud
  28. on the phone
  29. use it on any device
  30. 3
  31. Art
  32. on the phone
  33. 2
  34. Maths
  35. on the phone
  36. 1
  37. photos on two devices
  38. your last game level
  39. 5
  40. Stars

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