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

Answer key

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

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