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
Q: Write a function replace_head_tail that takes a string str1 and replaces the first X and last Y…
A: Please find the answer below :
Q: Given what is supposed to be typed and what is actually typed, write a function that returns the…
A: function findBrokenKeys(str1, str2) { var brokenLetters = []; for (var i=0; i<str1.length; i++) {…
Q: New York is 11 hours behind Bangkok. You will write a function nycHour (bkkHour: int) -> str that…
A: A 24-hour format time ca be converted to 12-hour format by subtracting 12 from 24-hour time when…
Q: 1- Write a function that takes a word less than 25 characters long and returns the letter that word…
A: NOTE:- AS PER OUR POLICY WE CAN SOLVE ONLY ONE QUESTION AT A TIME. SO, PLEASE REPOST THE REST…
Q: Write a program that uses the function isPalindrome. Modify the function isPalindrome so that when…
A: Below program outputs if the input string is a palindrome or not. The function isPalndrome takes the…
Q: You must answer the Problem in C++. (Anagrams) Write a function that checks whether two words are…
A: #include <iostream> #include <string> using namespace std; bool isAnagram(const string…
Q: In C language, Write a function that gets a string containing a positive integer. The function…
A: Step 1: Prompt and accept an integer value and store it as a string. Step 2: Convert it to long long…
Q: Write a C++ function Reverse that takes two string as input form user, compare the length of these…
A: Program Approach: Include necessary header files. Defining a method "Reverse" that accepts two…
Q: In c++ write a function, reverseDigit, that takes an integer as a parameter and returns the number…
A: Code: #include <iostream> using namespace std; int reverseDigit(int);//declaring the…
Q: 1- Write a function that takes a word less than 25 characters long and returns the letter that word…
A: #include <stdio.h> #include <string.h> #include <ctype.h> // returns the first…
Q: Write a function inflation that accepts a string txt, scans txt for strings of digits, and then…
A: Python code for this is attached with this answer. Please note that sometimes this website adds an…
Q: Write a function that takes a string as input and PRINTS the following pattern on the screen based…
A: Here I have first of all created a function stringShift that will print the string by shifting each…
Q: Write the definition of the string function named L() that takes no parameters and returns a string…
A: Let's move on the function definition in the next step. I have included the explanation in comments…
Q: Write a function called convert_case( string, upper=False ) that takes a string and returns a new…
A: As per the Bartleby guideline, the first question only get solved, If you have multiple questions in…
Q: Write a program with a function that takes a string; if the length of a string is even, the function…
A: Algorithm: If the length of string is odd then (*) will be put after the string If the length of…
Q: Write a C++ program that would implement the function called filterString which accepts a string s…
A: Here I have defined the function filterString(). Inside the function, I have looped over the string…
Q: The function f(s,ch) gets a strings and a character ch. Then it returns a string that is similar to…
A: Answer: Here is the complete code for the function f:
Q: 3. Write and test a function hydroxide that returns a 1 for true if its string argument ends in the…
A: The complete code is given below.
Q: Define a function FilterVal) that takes a string parameter and returns "Yes" if the length of the…
A: logic:- In function use string.length() to calculate length of input. If it is greater than 4…
Q: Write a function secondIndexOf, taking two strings and determining the second occurrence of the…
A: Note: Programming language is missing in the question. So we will answer this program in Python…
Q: 8. Write a function called string_reverse() that accepts a string from the user as a parameter. The…
A:
Q: Complete the below function which takes an integer k and a string s as its arguments and returns a…
A: def solve(k,inputStr): if len(inputStr) < k: return " " outputStr = ""…
Q: Define a function in JAVA that takes a string str as a parameter and returns a string that contains…
A: Define a function in JAVA that takes string str as a parameter and returns a string that contains…
Q: Write a function anagram that accepts two text strings and returns True if the strings are anagrams…
A: Write a function anagram that accepts two text strings and returns True if the strings are anagrams…
Q: Write a isPalindrome Function Write a function isPalindrome($str) that returns true if the parameter…
A:
Q: In Python, program a function called "capitalizePhrases", with the following heading: #…
A: Algorithm: Start Read a string upperText Implement a function capitalizePhrases() which takes a…
Q: Write a function that receives an integer. The function must return a string containing thebinary…
A: Purpose of the program: We need to provide a function having an integer and returns a string…
Q: Write a function that counts and returns the number of vowels in the string. (For the purposes of…
A: The main objective of the c++ program, main. cpp is to prompt the user to enter the menu choice. The…
Q: d) Write a function in SWIFT language that takes a string as a parameter and returns a string after…
A: We need to write a Swift language program. We need to write a function that takes a string as a…
Q: Write a program with a function that accepts a string as an argument and returns a copy of the…
A:
Q: Write a function countdownFront($str, $num) that returns a string made of the first $num characters…
A: Algorithm : countdownFront function : Parameters : string and number. Step 1 : use first for loop…
Q: Create a function that takes a string with at least one sentence in it and returns a string with the…
A: function reverseLegoYoda(text) { let arr; let tex = ""; let array = text.split(". "); for (let i =…
Q: Create a function reduce, which takes a string as its argument and prints the reduced characters of…
A: Question:
Q: Write a value-returning function isVowel that returns the value true if a given character is a vowel…
A: Programming Language used: C++ Language C++ code for the given scenario is as follows: #include…
Q: Write a function that prompts the user to input a sentence. Then checks the sentence to make sure…
A: Python Code:import randomdef fixer(): # sentence input sentence=input() # converting…
Q: Write a function biggestBuried(s), which the parameter s is a string, and the function returns the…
A: 1) Below is program that define function biggestBuried(s), in which the parameter s is a string, and…
Q: Write a C function which takes a sentence and a positive integer number, n. And delete nth word in…
A: #include <stdio.h> int main(void) { int i,blank=0,pos,wordlen; int fpos=0; char…
Q: In JAVA language: Define a function in which a string is passed as a parameter and the function…
A: According to the Question below the Solution: Output:
Q: Write a function called is_palindrome that accepts a string and returns whether or not it is a…
A: The required Python code is given below: def is_palindrome(string): # function to check string is…
Q: Write a program where you read in two words from the key Write a function which gets a string and…
A: Note: You did not specify which language need to use to solve this program therefore I am using java…
Q: Write a function, isPalindrome, that returns true if a string is a palindrome and false otherwise. A…
A: Check till half of string and compare with respective item from last If there is any mismatch then…
Q: Write a declaration for a function named getUpper which accepts a lowercase word as an input…
A: Since you have asked multiple questions, according to the company's policy we will solve the first…
Q: 1- Write a function that takes a word less than 25 characters long and returns the letter that word…
A: To find the capital letter of a word, we can test it against the ASCII values. We know that the…
Q: Write a function to pig latin that converts a word into pig latin, by: 1. Removing the first…
A: Python used to answer this question
Q: Write a C function delWordN() that takes a string and an integer (n) as parameter, removes from the…
A: Write a C function delWordN() that takes a string and an integer (n) as parameter, removes from the…
Q: Write a function that returns true if the two provided license plates strings are visually similar.…
A: #method that takes a string and removes everything other than uppercase letters and numbers def…
Q: Write a function called translate_to_italian () that takes a string as a parameter (a colour).…
A: We chose C++ to execute this logic but this can be applied in any programming language.
Q: Write a function that checks whether two words are anagrams. Two words are anagrams if they contain…
A: #include <iostream>#include <string>using namespace std; bool isAnagram(const string…
Q: Write a function findFirstUpper() that takes a string as parameter, finds returns the index of the…
A: I have given an answer in step 2.
Q: Write a function hasBothCases that takes a a c-string and determines if it contains both the upper…
A: Inside the function hasBothCases, use of ASCII values of character can be utilized. The difference…
Can u solve 8 and 9 in Python. I will rate you
Step by step
Solved in 3 steps with 2 images
- 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')) answer should be 51 print(biggestBuried('kkk32abce@@-33bb14zzz')) answer should be 33 print(biggestBuried('this15isast22ring-55')) answer should be 55Write a function that replaces a substring with a new string. Example: >>> replace('The quick brown fox jumps over the lazy dog', 'quick', 'slow') The slow brown fox jumps over the lazy dog The first parameter is the string, second is the substring to be replaced and the third is the string to replace the substring. If there are more than one occurrence of a substring, replace it all.Write a function replace_head_tail that takes a string str1 and replaces the first X and last Y characters of the string and returns the resulting string. For example, replace_head_tail("corona virus", 4, 3) returns "rusna vicoro".
- please code in python Write a function that receives a string and a number (n) as parameters and returns a new string that contains only every nth letter from the given string. print(everyNth('banana', 2)) # should return aaaprint(everyNth('carrot', 3)) # should return rtprint(everyNth('pear', 1)) # should return pearWrite a function called extractor() that takes a name as a parameter and counts every vowel present in it. The function should also identify and contact the consonants in another string. Finally, RETURN the total number of total vowels present in the name and the consonant string.Note: The name could be a mixture of uppercase & lowercase letters.Sample Input 1:MuhaiminulFunction call 1:extractor("Muhaiminul")Sample Output 1:(5, 'mhmnl')Explanation 1:Here, in the given name, we have 5 vowels (uaiiu). That's why 5 in the output. 'mhmnl' are the consonants present in the name.Sample Input 2:iLiyanaFunction call 2:extractor("iLiyana")Sample Output 2:(4, 'lyn')Explanation 2:Here, in the given name, we have 4 vowels (iiaa). That's why 4 in the output. 'lyn' are the consonants present in the name.Write a function called isVowel that receives one parameter as character and returns true ifit is a vowel (A, E, I, O, U) letter. Write another function called replaceV that receives two parameters as string(parameter1) and character (parameter2) and returns a new string that replaces all the vowel letters fromparameter1 with parameter2. The replaceV function should use isVowel function to check each character inthe string.Write a test program that reads a string and a character and uses replaceV to get the new string then displaysthe new string. Here is a sample run:Enter a String: Hello world!Enter a character: $The new string is: H$ll$ w$rld!
- Write a function isAlpha() that accepts a string as a parameter and returns true if all of the characters of the string parameter are English alphabet characters (Hint: in ASCII table the alphabetic characters have codes in range 65-90 and 97-122). Spaces (ASCII code: 32) should be ignored. Test your function. Your program output should look like the following: Output1: Enter string: hello there 123false Output2: Enter string: my name is johntrue C++ Nothing too advanced pleaseWrite a function that counts and returns the number of vowels in a word. The function's one parameter is a constant string reference The function returns the number of vowels in the string parameter as an int A word is a collection of letters of the alphabet. The normal vowels are the letters, ignoring case, A, E, I, O, U If a word does not contain any normal vowels, then, ignoring case, Y is a vowel. for example "yellow" contains two normal vowels, "o" and "w" "pygmy" contains no normal vowels but contain two vowels, two occurrences of "y" "psst" contains neither normal vowels nor "y"s "y" is not a vowel in "yellow" but "y" is a vowel in "pygmy" Create a text file of words, one word per line Apply the function to each word in the file The program displays each word and its vowel count on its own line For example, john 1 threw 1 the 1 orange 3 into 2 the 1 sky 1 ---------------------------------------------------------------------------------------------------------- Criteria 1)…Create a function sumofAllOdd(s,e) that will return the sum of all odd numbers in a range of inputted numbers s (starting number), e(ending number). For example: Test Result sumofAllOdd(22,55) sumofAllOdd(5,10) Answer:(penalty regime: 10, 20, ... %)
- Write a function str_replace that takes three strings, str1, str2 and str3; and replaces the first occurence (if any) of str2 in str1 with str3, and returns the newly formed string. For example, str_replace("Nuclear Energy Engineering", "Nuclear Energy", "Mechanical") returns "Mechanical Engineering"Write a function that when given a URL as a string, parses out just the domain name and returns it as a string. Examples:domain_name("http://github.com/SaadBenn") == "github" domain_name("http://www.zombie-bites.com") == "zombie-bites"domain_name("https://www.cnet.com") == "cnet"Note: The idea is not to use any built-in libraries such as re (regular expression) or urlparse except .split() built-in function""" # Non pythonic waydef domain_name_1(url): #grab only the non http(s) part full_domain_name = url.split('//')[-1] #grab the actual one depending on the len of the list actual_domain = full_domain_name.split('.') # case when www is in the url if (len(actual_domain) > 2): return actual_domain[1] # case when www is not in the url return actual_domain[0] # pythonic one linerdef domain_name_2(url):Write a function hasBothCases that takes a a c-string and determines if it contains both the upper and lowercase forms of a letter, returning 11 if both the upper and lowercase form of a letter are part of the string and returning 00 if no such letter exists. For example, hasBothCases should return 11 for the strings "Nine", "Lowell", and "o_O", but should return 00 for "nine", "Massachusetts", and "zyBooks". HINTS: You can make use of either the following: (1) Assume that the <ctype.h> library has already been #included. 2) Upper case letter A starts at 65 and Upper case Z is 90 in ASCII code, while lower case a starts at 97 and z is 122. NOTE: You only need to write the function. In C programming