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

Answer key

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

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