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

Answer key

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

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