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

Answer key

  1. False
  2. your last game level
  3. a class leaderboard
  4. True
  5. Science
  6. 10
  7. Music
  8. 11
  9. chat messages to friends
  10. 4
  11. a named box for a value
  12. True
  13. on the phone
  14. use it on any device
  15. data saved on the phone
  16. 0
  17. Science
  18. 4
  19. notes to read offline
  20. 4
  21. False
  22. Zoya
  23. Art
  24. 6
  25. True
  26. Meera
  27. False
  28. 5
  29. a shared to-do list
  30. 6
  31. in the cloud
  32. 2
  33. False
  34. 6
  35. the phone is lost
  36. in the cloud
  37. 3
  38. a list
  39. True
  40. Maths

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