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

Answer key

  1. Science
  2. 3
  3. chat messages to friends
  4. in the cloud
  5. data saved on the phone
  6. Music
  7. in the cloud
  8. Maths
  9. Rain
  10. False
  11. Kites
  12. a class leaderboard
  13. 7
  14. on the phone
  15. 4
  16. 3
  17. Kites
  18. Sunrise
  19. False
  20. 6
  21. a named box for a value
  22. 11
  23. 6
  24. Science
  25. Kabir
  26. a list
  27. 6
  28. True
  29. Meera
  30. 6
  31. 3
  32. 6
  33. Arjun
  34. 3
  35. 5
  36. False
  37. 2
  38. a shared to-do list
  39. Sports
  40. Zoya

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