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

Answer key

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

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