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

Answer key

  1. data saved on the phone
  2. True
  3. False
  4. in the cloud
  5. a list
  6. 0
  7. False
  8. Hindi
  9. Monsoon
  10. notes to read offline
  11. 6
  12. 5
  13. 3
  14. 5
  15. on the phone
  16. False
  17. 4
  18. 3
  19. True
  20. Science
  21. Maths
  22. 6
  23. use it on any device
  24. the sound on/off setting
  25. a class leaderboard
  26. Hindi
  27. Music
  28. 3
  29. Aman
  30. a draft you are typing
  31. Monsoon
  32. 9
  33. 8
  34. Science
  35. a named box for a value
  36. Maths
  37. in the cloud
  38. Riya
  39. photos on two devices
  40. Aman

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