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

Answer key

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

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