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

Answer key

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

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