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

Answer key

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

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