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

Answer key

  1. False
  2. a named box for a value
  3. in the cloud
  4. 1
  5. 4
  6. True
  7. Art
  8. the sound on/off setting
  9. Meera
  10. True
  11. 5
  12. Stars
  13. 5
  14. True
  15. a shared to-do list
  16. False
  17. data saved on the phone
  18. True
  19. True
  20. on the phone
  21. Arjun
  22. True
  23. 3
  24. Maths
  25. 4
  26. on the phone
  27. False
  28. Music
  29. 11
  30. Sunrise
  31. 10
  32. on the phone
  33. notes to read offline
  34. a class leaderboard
  35. Riya
  36. a draft you are typing
  37. 7
  38. 6
  39. 0
  40. 10

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