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

Answer key

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

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