Define a value-returning function replaceBlanks with one string parameter. The function will replace all blanks at the beginning of any string given as argument with the changed string. In your solution, do not use any of the string methods. Here are some tips how to solve this problem. and return Call and test your function in a print statement. Test your function using the following arguments: House is red" a) b) * c) “ house ' (just blanks) Challenge: Also replace all blanks at the end of the string given as argument.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 12PE: Write a program that takes as input five numbers and outputs the mean (average) and standard...
icon
Related questions
Question

please use python thanks

Define a value-returning function replaceBlanks with one string parameter.
The function will replace all blanks at the beginning of any string given as argument with "_" and return
the changed string.
In your solution, do not use any of the string methods.
Here are some tips how to solve this problem.
Call and test your function in a print statement. Test your function using the following arguments:
a) “
b) “
c)“ house
House is red"
(just blanks)
Challenge: Also replace all blanks at the end of the string given as argument.
Transcribed Image Text:Define a value-returning function replaceBlanks with one string parameter. The function will replace all blanks at the beginning of any string given as argument with "_" and return the changed string. In your solution, do not use any of the string methods. Here are some tips how to solve this problem. Call and test your function in a print statement. Test your function using the following arguments: a) “ b) “ c)“ house House is red" (just blanks) Challenge: Also replace all blanks at the end of the string given as argument.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr