DevJourney · code I wrote while learning

README.md

1.3 KB

Replace Vowels with Specific Consonant

Single File Programming Question

Problem Statement

Cindy is working on a text processing program, and she needs your help. The program is designed to replace all vowels in a given text with a specified consonant.

Create a file named file1.txt and prompt the user to input a text. Write the user's input into file1.txt. Then, read the content perform a specific logic (replacing vowels with a consonant provided by the user), and write the modified result into a new file named file2.txt. Lastly, display the modified result obtained from file2.txt.

Input:

format :

The first line of input consists of a string, representing the text that needs vowel replacement.

The second line is a single character value, representing the consonant to replace the vowels with.

Output:

format :

The output displays the string representing the modified text after replacing the vowels with the specified consonant.

Refer to the sample output for the formatting specifications.

Code constraints : The given testcases fall under the following constraints:

The string contains lowercase and uppercase with at most 80 characters.

Sample test cases :

Input 1:

Hello World
X
Output 1 :
HXllX WXrld
Input 2 :
Programming is fun
y
Output 2 :
Prygrymmyng ys fyn
Input 3 :
Apple
r
Output 3 :
rpplr