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

Answer key

  1. use it on any device
  2. 4
  3. Sports
  4. on the phone
  5. Zoya
  6. False
  7. notes to read offline
  8. the sound on/off setting
  9. 3
  10. in the cloud
  11. on the phone
  12. Science
  13. True
  14. Zoya
  15. a named box for a value
  16. 0
  17. 4
  18. False
  19. Monsoon
  20. your last game level
  21. 3
  22. the phone is lost
  23. 5
  24. 4
  25. Music
  26. 5
  27. Kites
  28. 3
  29. Kabir
  30. Kites
  31. Arjun
  32. True
  33. on the phone
  34. 3
  35. 4
  36. on the phone
  37. Rain
  38. 5
  39. True
  40. Meera

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