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

Answer key

  1. False
  2. Sports
  3. a shared to-do list
  4. a list
  5. data saved on the phone
  6. a named box for a value
  7. notes to read offline
  8. 1
  9. on the phone
  10. 7
  11. 7
  12. a draft you are typing
  13. 4
  14. Maths
  15. 5
  16. 4
  17. 3
  18. Zoya
  19. Sunrise
  20. use it on any device
  21. Kabir
  22. 3
  23. 5
  24. 10
  25. 4
  26. Maths
  27. 5
  28. the phone is lost
  29. 4
  30. a class leaderboard
  31. chat messages to friends
  32. photos on two devices
  33. False
  34. 6
  35. 7
  36. Maths
  37. True
  38. 5
  39. True
  40. your last game level

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