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

Answer key

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

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