8. Write a function biggestBuried(s), which the parameter s is a string, and the function returns the largest integer buried in the string. If there is no integer inside the string, then return 0. For example, biggestBuried('abcd51kkk3kk19ghi') would return 51, and biggestBuried('kkk32abce@@-33bb14zzz') would return 33, since the " character is treated like any other non digit. Note that a character is a digit if it is greater than or equal to '0' and less than or equal to '9'. Alternatively, you can use string.isdigit() to check if the string is a digit. Use the function in a program to test that it works properly by saying print(biggestBuried('abcd51kkk3kk19ghi')) print(biggestBuried(kkk32abce@@-33bb14zzz')) print(biggestBuried('this15isast22ring-55')) answer should be 51 answer should be 33 answer should be 55

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 22PE
icon
Related questions
Question

Can u solve 8 and 9 in Python.  I will rate you

8. Write a function biggestBuried(s), which the parameter s is a string, and the function returns
the largest integer buried in the string. If there is no integer inside the string, then return 0. For
example, biggestBuried('abcd51kkk3kk19ghi') would return 51, and
biggestBuried('kkk32abce@@-33bb14zzz') would return 33, since the '-' character is treated
like any other non digit. Note that a character is a digit if it is greater than or equal to '0' and
less than or equal to '9'. Alternatively, you can use string.isdigit() to check if the string is a
digit. Use the function in a program to test that it works properly by saying
print(biggestBuried('abcd51kkk3kk19ghi'))
print(biggestBuried('kkk32abce@@-33bb14zzz'))
print(biggestBuried('this15isast22ring-55'))
9. Write a function squareRoot(x, epsilon) that uses bisection search to return a number y that is
close enough to the square root of x, so that abs(y**2 - x) < epsilon. Try out the function in a
program to verify that it works properly.
answer should be 51
answer should be 33
answer should be 55
Transcribed Image Text:8. Write a function biggestBuried(s), which the parameter s is a string, and the function returns the largest integer buried in the string. If there is no integer inside the string, then return 0. For example, biggestBuried('abcd51kkk3kk19ghi') would return 51, and biggestBuried('kkk32abce@@-33bb14zzz') would return 33, since the '-' character is treated like any other non digit. Note that a character is a digit if it is greater than or equal to '0' and less than or equal to '9'. Alternatively, you can use string.isdigit() to check if the string is a digit. Use the function in a program to test that it works properly by saying print(biggestBuried('abcd51kkk3kk19ghi')) print(biggestBuried('kkk32abce@@-33bb14zzz')) print(biggestBuried('this15isast22ring-55')) 9. Write a function squareRoot(x, epsilon) that uses bisection search to return a number y that is close enough to the square root of x, so that abs(y**2 - x) < epsilon. Try out the function in a program to verify that it works properly. answer should be 51 answer should be 33 answer should be 55
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
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