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

Answer key

  1. a list
  2. 3
  3. in the cloud
  4. a named box for a value
  5. on the phone
  6. 0
  7. Maths
  8. notes to read offline
  9. Kabir
  10. Rain
  11. data saved on the phone
  12. False
  13. 5
  14. chat messages to friends
  15. Zoya
  16. 5
  17. Art
  18. the phone is lost
  19. in the cloud
  20. on the phone
  21. 7
  22. 3
  23. a class leaderboard
  24. on the phone
  25. 9
  26. 5
  27. 4
  28. 6
  29. a shared to-do list
  30. True
  31. Sunrise
  32. in the cloud
  33. Art
  34. Riya
  35. True
  36. Sports
  37. True
  38. the sound on/off setting
  39. Zoya
  40. Art

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