Question: 1) Define and test a void function with one string parameter. The function converts each fower-case character of the string entered to upper-case and prints

 1) Define and test a void function with one string parameter.

1) Define and test a void function with one string parameter. The function converts each fower-case character of the string entered to upper-case and prints it. All other characters stay the same and get printed. Use a string traversal algorithm with a for loop and a range or a with a while loop in your solution. Do not use the upper(]) string method. Challenge: Convert and print the characters of the string, backwards. (No recursionl) 2) Define a void function called printAddress. The function will accept one (single!) string as parameter. This string has the format of an address: street address, city, province, postal code (items separated by commas). For any string entered as argument, the function will print out the street address, the city followed by the postal code, and the province each on a separate line. How to solve the problem? Use the string method find (...) to find the indices of the commas. Then apply string slicing. The street address is the substring before the first The city is the substring between the first comma and the second comma. The province is the substring after the second comma and before the third comma. The postal code is after the third comma Cail and test your function with your own address as string argument. 3) Define a value-returning function trimBlanks with one string parameter. The function will remove all bianks at the beginning of any string given as parameter and retum the changed string. In your solution, do not use any of the string methods. Challenge: Also remove all blanks at the end of the string given as paramoter. Call and test your function in a print statement. Test your function using the following arguments: a) " House is red" b) " "(only blanks) c) "house - How to solve the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!