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

Answer key

  1. in the cloud
  2. a draft you are typing
  3. Art
  4. chat messages to friends
  5. 5
  6. 1
  7. 4
  8. your last game level
  9. Science
  10. True
  11. Music
  12. on the phone
  13. 5
  14. in the cloud
  15. data saved on the phone
  16. 2
  17. on the phone
  18. Rain
  19. 0
  20. photos on two devices
  21. True
  22. 2
  23. Monsoon
  24. 4
  25. the sound on/off setting
  26. in the cloud
  27. 3
  28. 6
  29. 6
  30. 5
  31. Arjun
  32. 5
  33. 6
  34. on the phone
  35. Arjun
  36. 7
  37. 6
  38. 2
  39. a shared to-do list
  40. on the phone

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