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

Answer key

  1. Ocean
  2. 3
  3. Zoya
  4. False
  5. 2
  6. a class leaderboard
  7. Science
  8. Rain
  9. Sunrise
  10. 5
  11. 5
  12. in the cloud
  13. 4
  14. 2
  15. False
  16. False
  17. 4
  18. Kites
  19. Art
  20. a draft you are typing
  21. Monsoon
  22. a list
  23. data saved on the phone
  24. False
  25. Hindi
  26. Sunrise
  27. the phone is lost
  28. in the cloud
  29. 0
  30. on the phone
  31. chat messages to friends
  32. a named box for a value
  33. 8
  34. your last game level
  35. a shared to-do list
  36. Monsoon
  37. True
  38. False
  39. on the phone
  40. Stars

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