Computer Science 9618 Paper 4 Stacks With a File

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 5

  • @shoop3392
    @shoop3392 6 месяцев назад

    thank you erb computer science

  • @reflectmirror6371
    @reflectmirror6371 5 месяцев назад

    Sir can we use the index of the array to check if the stack is empty instead of "If TempData "The vowel stack is empty" " as we declared the index of both stack as global.

    • @erbcomputerscience
      @erbcomputerscience  5 месяцев назад

      Good afternoon. That is a great question. A stack can be used by implementing it using a 1D array. Because it is a stack we should be using the stack pointers to keep track of the values in the stack and not specifically the index of the array even though the pointer points to a specific index. Also, if we look at the question for part d step 3: "depending on the user's choice call PopVowel() or PopConsonant()... If we look back into when we wrote these functions it mentions returning a string. Because we are returning a string we aren't able to return the index number. This question (for part d) requires us to use the functions PopVowel() and PopConsonant() dependent upon the user's choice. Could you check the index - technically speaking you could however Cambridge would not award you points because you are checking the index of the array instead of using the pointer that is used in the functions. Hope this helps. Let me know if you have any more questions!

    • @reflectmirror6371
      @reflectmirror6371 5 месяцев назад

      @@erbcomputerscience Understood. Thanks