Explanation of the Solution | Classes and files
4. Katas
To see full version of Solution visit GitHub. See below↓
Solution:
- Create class.
- Create a constructor method in a class that takes one variable (a string). In the constructor itself, we define four variables (our string, a sheet of vowels and two files into which we will write our lines)
- Create a function to write a string to a file that takes a string and a file name.
- Create a function to convert a string to a string without vowels
-
In the function:
- Write a string to a new variable.
- We run through the whole change and delete the vowels.
- Write our string to a file.
- Returning our string.
- Create a function for converting a string to a string without consonants, the same action algorithm as the previous function.
- We create a method for printing a class that will print a string that we need by convention.
- We call our classes with certain strings.
- Print classes.
That's all.
If you liked Katas, you can put star on this repositories, this will motivate me to write similar Katas for you.
Visit Github page: