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

Answer key

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

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