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

Answer key

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

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