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

Answer key

  1. 3
  2. notes to read offline
  3. on the phone
  4. in the cloud
  5. True
  6. Sports
  7. 5
  8. True
  9. chat messages to friends
  10. 6
  11. True
  12. the sound on/off setting
  13. 6
  14. Music
  15. on the phone
  16. photos on two devices
  17. 7
  18. False
  19. False
  20. 8
  21. 4
  22. Sunrise
  23. a named box for a value
  24. 4
  25. a class leaderboard
  26. a list
  27. 6
  28. True
  29. 6
  30. False
  31. your last game level
  32. Kites
  33. Maths
  34. 6
  35. 4
  36. 5
  37. 5
  38. True
  39. on the phone
  40. 7

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