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

Answer key

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

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