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

Answer key

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

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