1- Write a function that takes a word less than 25 characters long and returns the letter that word starts with (in capital letters). Frank starts with the letter F.
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: 2. Write a function called word_count() that accepts a string as a parameter and returns an integer…
A: Here, we are going to write a function called word_count() which count the number of words in a…
Q: Q1: Write a function that receives marks received by a student in 3 subjects and returns the average…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: 1. Write and test a function letterCounts(text) that calculates how many times each letter of the…
A: I give the code in Python along with output and code screenshot
Q: Write a function void printTriangle(char* str) that gets a string from the user up to…
A: Since you are not mentioning the programming language, here we are using "C" to complete the…
Q: change.py Create a program, change.py, that has a function that takes 5 arguments that…
A: According to the information given:- We have to follow the instruction to create a program,…
Q: 3.41 Write function lastF() that takes as input two strings of the form 'FirstName' and 'LastName',…
A: def lastF(FirstName,LastName):name="'"name=name+LastNamename=name+","+FirstName[0]+"'"return…
Q: 4- Write a function to find the maximum number of 3 entered numbers.
A: 4. Algorithm: 1. Start 2. Declare num1,num2,num3,result 3. Read num1,num2,num3 4. Calculate result…
Q: EXERCISE 14 Write a function Your first name_Last name_Ex14 with input arguments to be the magn…
A: Following is the Matlab code for the given problem : function…
Q: Q1/ Write a program in C++ by using function to remove the spaces before and after the entered text,…
A: Please find the answer below :
Q: Complete the following sentence. The function takes in a string as input and returns the characters…
A: The input string is a sequence of characters that can be interpreted as a numeric value of the…
Q: 1- How many arguments can a C++ function have? a) One. b) Two. c) Three. d) Unlimited 2- What is a…
A: 1- How many arguments can a C++ function have ? C and C++ standard didn't place an absolute…
Q: 5: Complete the function that takes in a number x, and returns the value 1 if x > 0, otherwise it is…
A: Logic:- within step_function use if else to check value of x is greater than or equal to 0 or not.…
Q: A ( 8. Write a function which is given an exam mark, and it returns a string - the grade for that…
A: 1) Below is program to define the function which returns grade for a mark. Test with list of marks…
Q: Complete the function int asSum(string) which takes a string argument and returns the sum of ASCIlI…
A: Inside asSum function initialise an integer variable to store the sum of ASCII values of all…
Q: Q1: Define a function called sign which takes a numerical argument and returns -1 if it's negative,…
A: The Python code for the question is given below. Also, a snapshot of code and output is provided.
Q: R programming Create a function that takes a character vector as input and and returns numerical…
A: Algorithm: Start Implement a function generate() which takes a string 'x' as argument Inside the…
Q: 03 Write a C++ simple code to read a student name and grade for two student (Using Structure), then…
A: #include <iostream>using namespace std; struct student{ char name[50]; int roll;…
Q: Q1: Write a function that receives marks received by a student in 3 subjects and returns the average…
A: The given scenario is programmed by C language. The program takes the input from the user where it…
Q: 1. Write a function inp that asks the user to input two integers a and b provided in the argument…
A: Ques 1) Now, we have to wite a function that accept two integer arguments and return 1 if a is less…
Q: Write a function that takes a reference to a string as an argument and which converts the string to…
A: The isupper() function checks if ch is in uppercase as classified by the current C locale
Q: Complete the function definition given below. void printM(string s){ //display the string s with the…
A: Note - As you haven't specified particular programming language to write code in, I have written the…
Q: A4. Write a function to check weather a string is all uppercase or not. Your function should return…
A: Given: php programming
Q: 18-Write a function called items_price that receives 2 lists as input .The first list contains n…
A: Algorithm of function items_price(a, b): 1. Find length of list a as length. 2. Initialize price to…
Q: A number is said to be Harshad if it's exactly divisible by the sum of its digits. Create a function…
A: Calculate the sum of digits Check whether sum is exact divisor of input number and return whether…
Q: Q4: Write a complete program that has another function beside the main function. This function swaps…
A: As programming language is not mentioned so we are providing answer in C++ language. Use call by…
Q: Part II: Write a program to calculate the area of a triangle given the length of its three sides-a,…
A:
Q: (Time in Seconds) Write a function that takes the time as three integer arguments (forhours,…
A: Lets see the solution.
Q: 17.49 Lab: Functions: Number to words Sometimes numbers are converted to words, like in a…
A: So, we need to write a C++ code to convert numbers into words with the given condition. Program…
Q: Write a function str_replace that takes three strings, str1, str2 and str3; and replaces the first…
A: Please find the answer below :
Q: Program 3: Write a value-returning function isVowel that returns the value true if a given character…
A: Aim: Write a value returning function isVowel to find if a character is a vowel or not. The program…
Q: Function name Function description Function Function output(s) / input(s) return value(s)…
A: We can implement all the functions by opening file and reading it.
Q: Q6: Complete the function that takes in a number x, and returns the value 1 if x > 0, otherwise it…
A: ## Define the function def step_function(z): # If the number is greater than or equal to 0, we…
Q: Create a function called (Ysum) that find the value of y from following equation:
A: In this question, the value of y is to be calculated using this given expression. EXPLANATION:…
Q: Create a function that receives 5 marks, regardless of the type of these marks. Calculate the…
A: ## As no programming language is mentioned, the code is written in Python. def…
Q: 4. (Reverse a string) Write a function that reverses a string. The header of the function is:
A: PROGRAM INTRODUCTION: Take the string from the user. Call the function bypassing the original…
Q: Write a function flipCase that accepts a word as an argument and returns the same word but with each…
A: Create a function flipCase(str). str will be the parameter and oncalling the function user will give…
Q: 5.27 (Prime Numbers) An integer is said to be prime if it's divisible by only 1 and itself. For…
A: In this program, you need to write a function which will determine number is prime or not. In this…
Q: Write and test a function to meet this specification.squareEach (nums) nums is a list of numbers.…
A: Write and test a function to meet this specification.squareEach (nums) nums is a list of numbers.…
Q: r) Input a string s that contains lowercase alphabets. Then write a function that takes the string s…
A: C++ program to solve the given problem is below.
Q: Create a C# function that counts how many D's are in a sentence. Sentence : The dad loves his son…
A: According to the information given:- We have to write c# code to count D's in the sentence.
Q: Q 5: Returning -value Function (return.py) Give an example from your own, of a program that use a…
A: Actually, function is a group of statements.
Q: 65. Write a function which accepts three positive integers (like n1, n2, n3) then calculates the…
A: 1) Below is python program that creates a functio which accepts three positive integers, calculate…
Q: Problem 2 - Write a function that gets a string argument and capitalizes all the vowels in that…
A: Step-1: Start Step-2: Declare a variable str and take input from user Step-3: Call function…
Q: 1. Write a function that takes a number and a character (as parameters) and prints a triangle of…
A: - We need to code the request in C++. - We have to do this using a function which takes an integer…
Q: Create a function that takes in top and bottom. You should return a random number between top and…
A: C++ used to answer this question
Q: c++ Create a function that receives a string representing a number in binary and returns this…
A: Hello Student. Greetings from my side. Hope you are doing great. I will try my best to answer your…
Q: Exercise - Seconds since midnight 1 Let's write a program that reads the time from the user as three…
A: 12 o' clock here is assumed to be the midnight 12 o' clock (12:00 am). 1 minute contains 60 seconds.…
this question is complete and not that complex but im just stuck on it (in language C)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- 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 that counts and returns the number of vowels in the string. (For the purposes of this exercise, we are talking about the standard 5 vowels -- A, E, I, O, U). Write a function that counts and returns the number of consonants in the string. Write a function that converts the string to all lowercase. Write a function that converts the string to all uppercase. Write the following functions. Each of these functions should have a single parameter -- accepting a c-style string as an argument. The function should only do what is specified (note that none of these functions do any output to the screen). Your functions should use const in the prototype wherever it is appropriate: Write the main function that offers a menu and allows the user to test the functions you have implemented. Program C++, must use c- styleWrite a isPalindrome Function Write a function isPalindrome($str) that returns true if the parameter string is a palindrome (a palindrome is a word or sentence that reads the same forward and backward at the character level). You should ignore non-letter characters when determining if the string is a palindrome. Thus, isPalindrome("A man, a plan, a canal, Panama!") should return true.
- 14. In written text small numbers are often written out, e.g. you'd write 'I have twobrothers and one sister', rather than 'I have 2 brothers and 1 sister'. Here we want toimplement one (1?) function that helps us realize this. Write a function smallnr() thattakes a number x and if x is an integer between 0 and 6 it returns the name of thenumber, otherwise it simply returns x as a string.>>> smallnr(2)'two'>>> smallnr(0)'zero'>>> smallnr(7)'7'Write 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".
- 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 which will take 2 arguments. They are: Sentence position Your first task is to take these arguments as user input and pass these values to the function parameters. Your second task is to implement the function and remove the characters at the index number which is divisible by the position (Avoid the index number 0 as it will always be divisible by the position, so no need to remove the index 0 character). Finally, add the removed characters at the end of the new string. Return the value and then finally, print the new string at the function call. ===================================================== Input:"I love programming."3Function call:function_name("I love programming.", 3)Output:I lveprgrmmngo oai. ============================================== Input:"Python is easy to learn. I love python."6Function call:function_name("Python is easy to learn. I love python.", 6)Output:Pythonis eay to earn.I lov pythn. sl eoplease 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 pear
- Write a function palindromes that accepts a sentence as an argument. The function then returns a list of all words in the sentence that are palindromes, that is they are the same forwards and backwards. The language is in Python. Guidelines: punctuation characters .,;!? should be ignoredthe palindrome check should not depend on case Example: >>> palindromes("Hey Anna, would you prefer to ride in a kayak or a racecar?") ['Anna', 'a', 'kayak', 'a', 'racecar']Write 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)…1. Write a function that converts a phrase into pig Latin. A word is convertedto pig Latin by removing the first character of the word, placing it at theback of the word, and adding the characters “ay” to the word. For example,“hello world” in pig Latin is “ellohay orldway.” Your function can assumethat each word consists of at least two letters and that each word is separatedby one space, with no punctuation marks.2. Write a function that counts the occurrences of a word in a string. Thefunction should return an integer. Do not assume that just one space separates words and a string can contain punctuation. Write the function sothat it works with either a String argument or a StringBuilder object.3. Write a function that takes a number, such as 52, and returns the numberas a word, as in fifty-two.4. Write a subroutine that takes a simple sentence in noun-verb-object formand parses the sentence into its different parts. For example, the sentence“Mary walked the dog” is parsed into…