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

Answer key

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

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