1. 26.
    0
    konu nedir?
    ···
  2. 27.
    0
    konu nedir?
    ···
  3. 28.
    0
    konu nedir?
    ···
  4. 29.
    0
    konu nedir?
    ···
  5. 30.
    0
    konu nedir?
    ···
  6. 31.
    0
    printf konu nedir?
    ···
  7. 32.
    0
    konu nedir?
    ···
  8. 33.
    0
    konu nedir?
    ···
  9. 34.
    0
    konu nedir?
    ···
  10. 35.
    0
    getch terk konu ne amk
    ···
  11. 36.
    0
    konu budur:
    Brief Description
    In this homework, you will write a simple program that searches for a string in another string. There are some special searching parameters and details about it will be given in later sections. First your program will get a string until the word “END” or “end” is present and then it will ask for a search string. Your program should be able to do multiple searches until the search string “QUIT” or “quit” is entered.
    Inputs
    There are two inputs respectively; Source String and Search String. Both inputs are strings. You should note that there can be spaces between word for Source String (hint: use a while loop to read all words using cin). However, there can be no punctuation characters („.‟,‟;‟ etc.). For Search String, there can be no spaces or empty characters. Search String must end with one of „+‟ , ‟.‟ , ‟*‟. (See sample runs). Your program should take Source String only once, but ask for Search String until “QUIT” or “quit” is entered.
    Input Check
    All inputs must be checked. In the case of an invalid input, the program should ask for an input again and again until a correct input is entered (Hint: you may use while loop here). The rules of input check is given below: Source String must be stored to the point the word “END” or “end” is present. Search String must end with one of „+‟ , ‟.‟ , ‟*‟. Search String cannot be empty.
    Processing, Program Flow and Output
    Your program should start with an introductory explanation and a prompt for the input. After all the inputs are entered correctly, your program should search for the string according to the rules and print out the index of the searched word.
    Search Rules:
    Search String ends with a ‘+’: The word must start or end with search string.
    Example:
    Enter source string: Cars are fast END
    Enter search string: fa+
    index: 9 word: fast
    Search String ends with a ‘*’: Any word containing the search string.
    Example:
    Enter source string: Cars are fast END
    Enter search string: r*
    index: 2 word: Cars
    index: 6 word: are
    Search String ends with a ‘.’: The word ends with search string.
    Example:
    Enter source string: Cars are fast END
    Enter search string: s.
    index: 3 word: Cars
    An example for same search string with different search operators:
    Enter source string: Cars are fast END
    Enter search string: s+
    Enter search string: s*
    index: 3 word: Cars
    index: 11 word: fast
    Enter search string: s.
    index: 3 word: Cars
    Hint: You should use while loops and find() function of the string library. Please also note that you can use find(string searchWord, int position) to search after a given position in the string.
    Important Remarks
    Your program must be modular and you should avoid code duplication. Thus you have to show your ability to use functions in an appropriate way. This will affect your grade. In general, if your main function or any user-defined function is too long and if you do everything in main or in another user-defined function, your grade may be lowered.
    AND PLEASE DO NOT WRITE EVERYTHING IN MAIN AND THEN TRY TO SPLIT THE TASK INTO SOME FUNCTIONS JUST TO HAVE SOME FUNCTIONS OTHER THAN MAIN. THIS IS TOTALLY AGAINST THE IDEA OF FUNCTIONAL DESIGN AND NOTHING BUT A DIRTY TRICK TO GET SOME POINTS. INSTEAD PLEASE DESIGN YOUR PROGRAM BY CONSIDERING NECESSARY FUNCTIONS AT THE BEGINNING.
    Try to use parametric and non-void functions wherever appropriate. Do NOT use any global variables (variables defined outside the functions) to avoid parameter use.
    In this homework (and in the coming ones) you are not allowed to use instructions such as “exit” and “goto”. These cause difficulty to control the flow of your programs. Thus we do not approve using them. You are also not encouraged to use “break” and “continue”. The use of “break” and “continue” prevent you from forming good readable loop conditions and hence prevent you from learning how to form good loops. Think cleverly in order not to use any of these instructions. If you don't know these commands, do not even try to learn them (we will explain “break” in class).
    Please remark that there are two inputs described above in the Inputs part. While input order should be exactly the same as the sample runs, also no other input is allowed (such as a name for the introduction or anything else not mentioned in this homework specification). Since your submissions are processed automatically, extra inputs cause problems and delays in the processing and grading. If you do not follow this rule, your grade may be lowered.
    Sample Runs
    Below, we provide some sample runs of the program that you will develop. The italic and bold phrases are inputs taken from the user. The introductory line (This program bla bla bla) is intentionally left incomplete. You are expected to use your imagination and creativity there to introduce your program. You may also change the prompts and output lines, but you have to display the required information.
    Sample Run 1 (Normal run)
    Enter source string: Cars are fast END
    Enter search string: fast+
    index :9 word: fast
    Enter search string: r*
    index: 2 word: Cars
    index: 6 word: are
    Enter search string: s.
    index: 3 word: Cars
    Enter search string: s+
    Enter search string: s*
    index: 3 word: Cars
    index: 11 word: fast
    Enter search string: s.
    index: 3 word: Cars
    Enter search string: QUIT
    Press any key to continue . . .
    Sample Run 2 (Normal run)
    Enter source string: There are way too much homeworks in this class end
    Enter search string: are+
    index: 6 word: are
    Enter search string: a*
    index: 6 word: are
    index: 11 word: way
    index: 43 word: class
    Enter search string: a.
    Enter search string: t+
    index: 14 word: too
    index: 36 word: this
    Enter search string: th+
    index: 36 word: this
    Enter search string: QUIT
    Press any key to continue . . .
    Tümünü Göster
    ···
  12. 37.
    0
    konu nedir?
    ···
  13. 38.
    0
    konu nedir?
    ···
  14. 39.
    0
    konu nedir?
    ···
  15. 40.
    0
    @32 for loop'u yan yatır.
    ···
  16. 41.
    0
    konu nedir?
    ···
  17. 42.
    0
    konu nedir?
    ···
  18. 43.
    0
    konunun amk!
    ···
  19. 44.
    0
    konu nedir?
    ···
  20. 45.
    0
    konu nedir?
    ···