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

Answer key

  1. on the phone
  2. True
  3. Monsoon
  4. Rain
  5. on the phone
  6. a named box for a value
  7. 7
  8. True
  9. on the phone
  10. 6
  11. 0
  12. 6
  13. 5
  14. on the phone
  15. a shared to-do list
  16. photos on two devices
  17. in the cloud
  18. 2
  19. 5
  20. True
  21. 4
  22. a list
  23. 8
  24. Zoya
  25. 4
  26. a class leaderboard
  27. in the cloud
  28. 5
  29. 4
  30. chat messages to friends
  31. Art
  32. notes to read offline
  33. Meera
  34. True
  35. Zoya
  36. data saved on the phone
  37. in the cloud
  38. Hindi
  39. 4
  40. 6

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