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

Answer key

  1. on the phone
  2. 5
  3. in the cloud
  4. 6
  5. 3
  6. False
  7. Kites
  8. False
  9. Maths
  10. 2
  11. Maths
  12. Ocean
  13. Music
  14. data saved on the phone
  15. 3
  16. 4
  17. Rain
  18. 5
  19. 5
  20. use it on any device
  21. 5
  22. Science
  23. on the phone
  24. Maths
  25. False
  26. a named box for a value
  27. in the cloud
  28. True
  29. Music
  30. Music
  31. a class leaderboard
  32. notes to read offline
  33. a shared to-do list
  34. on the phone
  35. the sound on/off setting
  36. Music
  37. False
  38. 5
  39. 3
  40. 6

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