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

Answer key

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

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