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

Answer key

  1. Maths
  2. a draft you are typing
  3. 2
  4. 4
  5. data saved on the phone
  6. 9
  7. 6
  8. in the cloud
  9. Sunrise
  10. 3
  11. a list
  12. True
  13. 3
  14. 6
  15. False
  16. False
  17. 5
  18. 3
  19. False
  20. 9
  21. a shared to-do list
  22. in the cloud
  23. 4
  24. in the cloud
  25. True
  26. 0
  27. Art
  28. True
  29. notes to read offline
  30. a named box for a value
  31. 4
  32. 4
  33. Art
  34. 5
  35. 4
  36. True
  37. photos on two devices
  38. 6
  39. 6
  40. on the phone

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