Write a python function called replacer() that takes two strings as
arguments.
Argument1: A sentence where you have to make the changes.
Argument2: A word with the values either “vowel” or “consonant”.
Your function should replace the characters of the sentence with “V” or “C”
depending on the 2nd argument. If the word is “vowel”, then replace all the
vowels with “V”. If the word is “consonant”, then replace all the
consonants with “C”.
[You are not allowed to use the replace() function]
Function call1:
replacer("It is MAT110 final", "vowels")
Sample Output1:
Vt Vs MVT110 fVnVl
Function call2:
replacer("It is CSE110 final", "consonants")
Sample Output 02:
IC iC CCE110 CiCaC
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- Create a program in C that allows the user to prompt for the input of the author's last name, the publication year, and the publication city for the book. String input should accept spaces, since both names and cities (especially in publishing) may be multi-word. You also should abide by the rules of the Prgramming Recitation 1 with regards to error trapping. Turn in your .C file and your makefile. Get used to this: Exercises will have this tendency to be pieces of the recitiation. The hope is that you will get enough out of the exercises to be able to perform the work in the recitation.arrow_forward-Python3-arrow_forwardOutput the information as a formatted histogram. Each name is right justified with a width of 20. Ex: Jane Austen ****** Charles Dickens ******************** Ernest Hemingway ********* Jack Kerouac ********************** F. Scott Fitzgerald ******** Mary Shelley ******* Charlotte Bronte ***** Mark Twain *********** Agatha Christie ************************************************************************* Ian Flemming ************** J.K. Rowling ************** Stephen King ****************************************************** Oscar Wilde *arrow_forward
- Question no 2 pleasearrow_forwardDevelop a code in C++ programming language for the below listed problem: In this week's task you have to find if it's possible that a string containing alphabet can be reorder in such a way that there exists a string with prefix "POEM" and suffix "MEOP". Print "YES" if possible and "NO" if not possible. Input: РOЕМХҮМЕОР Output: YESarrow_forwardCreate a Python function “PolarToCartesian” that allows the user to convert from polar form to Cartesian form and vice versa. The function should print the result of conversion.Write a main code in which the user should choose the conversion he/she wants, then he/she should enter the number (real part and imaginary part if the input number is Cartesian, magnitude and phase if the input number is Polar)You can import ‘numpy’ for trigonometric functions and square root calculations, and you can import ‘math’ for math.pi number.arrow_forward
- c programing languagearrow_forwardQuestion: Write a function to display a pattern as follows: 1 2 1 n-1 2 1 Book: Introduction to programming using Python Author: Y. Daniel Liang Question: Chapter6, Page204, Question: 6.6arrow_forwardComplete the process_name() function that takes a single string parameter name. You can assume that the name will always be in the format first name surname with a single space character between the first name and the surname. The function returns a string consisting of the first letter of the first name followed by the first three letters of the surname. All of the characters in the returned string should be in lowercase. Some examples of the function being used are shown below: For example: Test Result print(process_name("Damir Azhar")) dazh print(process_name("Ann Cameron")) acam Answer: (penalty regime: 0 %) Reset answer 1v def process_name (name): 2arrow_forward
- in the C++ version please suppose to have a score corresponding with probabilities at the end and do not use the count[] function. Please explain the detail when coding. DO NOT USE ARRAY. The game of Pig The game of Pig is a dice game with simple rules: Two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 ("pig") is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two decisions: roll - if the player rolls 1: the player scores nothing and it becomes the opponents turn. 2 - 6: the number is added to the player's turn total and the player's turn continues. hold - The turn total is added to the player's score and it becomes the opponent's turn. This game is a game of probability. Players can use their knowledge of probabilities to make an educated game decision. Assignment specifications Hold-at-20 means that the player will choose to roll…arrow_forwardConsider the following line of code: X = new int*[n]; What should the type of x be? O int O int* O int** O int& O None of the abovearrow_forwardMatch the std::string constructor on right to its function on left. Source: https://cplusplus.com/reference/string/string/string/ E string() string (const string& str) string (const char* s) string (size_t n, char c) [Choose] [Choose ] constructs a copy of str. constructs an empty string, with a length of zero characters. copies the null-terminated character sequence (C-string) pointed by s. fills the string with n consecutive copies of character c. [Choose ]arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY