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

Answer key

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

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