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

Answer key

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

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