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

Answer key

  1. False
  2. 5
  3. in the cloud
  4. the phone is lost
  5. Music
  6. 4
  7. the sound on/off setting
  8. False
  9. 4
  10. a named box for a value
  11. False
  12. Hindi
  13. 5
  14. True
  15. notes to read offline
  16. data saved on the phone
  17. False
  18. True
  19. True
  20. True
  21. 4
  22. use it on any device
  23. Art
  24. 6
  25. 6
  26. 5
  27. True
  28. 11
  29. on the phone
  30. Science
  31. Maths
  32. a list
  33. Ocean
  34. Maths
  35. 6
  36. on the phone
  37. 0
  38. False
  39. Science
  40. 5

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