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

Answer key

  1. True
  2. on the phone
  3. Art
  4. True
  5. Riya
  6. False
  7. 8
  8. notes to read offline
  9. a draft you are typing
  10. True
  11. 5
  12. Sports
  13. 5
  14. Sports
  15. in the cloud
  16. data saved on the phone
  17. 3
  18. in the cloud
  19. Kabir
  20. Aman
  21. 5
  22. Zoya
  23. False
  24. 3
  25. the phone is lost
  26. in the cloud
  27. False
  28. Zoya
  29. Sports
  30. on the phone
  31. True
  32. 6
  33. a named box for a value
  34. the sound on/off setting
  35. in the cloud
  36. Rain
  37. a shared to-do list
  38. Maths
  39. False
  40. a class leaderboard

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