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

Answer key

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

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