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

Answer key

  1. True
  2. a shared to-do list
  3. Maths
  4. True
  5. a named box for a value
  6. on the phone
  7. chat messages to friends
  8. 5
  9. 8
  10. a draft you are typing
  11. False
  12. a list
  13. Music
  14. use it on any device
  15. 4
  16. a class leaderboard
  17. False
  18. True
  19. Stars
  20. data saved on the phone
  21. 6
  22. Stars
  23. Rain
  24. in the cloud
  25. 3
  26. Sunrise
  27. False
  28. False
  29. 4
  30. Kabir
  31. 0
  32. in the cloud
  33. False
  34. 7
  35. Ocean
  36. on the phone
  37. 10
  38. Aman
  39. 6
  40. 8

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