Write a function that gets a string as a parameter and reports (prints out) the number of lower case and upper-case characters in the string. The output should look like Your string has 200 characters, 120 of them are lower case and 25 of them are upper case alphabet letters. The allowed length for the string is 200
Q: Write a character-valued function named convertToGrade that has a single type int parameter named…
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions…
Q: Write a function definition for a function named getFirst that does the following: 1) Accepts an…
A: In any string the first character of the string is present at index 0. In the function if the input…
Q: Given below is a C++ function: string my_date(int dd, int mm, int yyyy){ //return a string of the…
A: Here I have created the function named my_date(). In this function, I have to_string() method to…
Q: Write a function for a simple game for two players that will generate a random 4 digit number (not…
A: Program Approach: Firstly using the package. Then using the namespace. Define the main Class.…
Q: ite a function named sumDigits which takes three parameters: f, t and x. sumDigits, then, finds the…
A: the program is an given beloe :
Q: Write a function countNonAlnum() that takes a string as parameter, finds and returns the number of…
A: Python offers built in method isalnum() which returns true is string is alphabet or numeric
Q: Question 1 Write a function that takes twɔ integers and returns the value that is greater. If the…
A: As per our guidelines we are supposed to answer only one question kindly repost other question as a…
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: Have the function StringChallenge(str) take the str parameter being passed and return the string…
A: As no language is mentioned I am assuming it to be JAVA after looking at the question, therefore I…
Q: Write a Boolean function called contains_whitespace() that accepts a string as a parameter and…
A: NOTE : As the question is not specific about the programming language to be used to code , so C++…
Q: Write a function called missing_letters that takes a string parameter and returns a new string with…
A: A string is a sequence of characters with a variable name. A string may be processed as an array…
Q: es a substring with a new string. Example: >>> replace('The quick brown fox jumps over the lazy…
A: Given : Write a function that replaces a substring with a new string. Example:>>>…
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 a function called extractor() that takes a name as a parameter and counts every vowel present…
A: Program: Program is used to provide the instructions, it is used to interact with the computer…
Q: Given a function below: int func (int num1, int num2=0, int num3=0) {return num1+num2+num3;} If we…
A: auto new_value=func(1,,2); in the above function call you must pass a value because the syntax…
Q: Use a C-Style string to write a function that will use "double" as a parameter. 1. How to get 0 to…
A: Use a C-Style string to write a function that will use "double" as a parameter.1. How to get 0 to…
Q: Make a function is_palindrome that takes a string as an argument that returns True if the given…
A: Algorithm: Step-1: Start Step-2: Take a input from user. Step-3: Create a function is_palindrome and…
Q: Write a function which takes input a string and an integer i as input parameter. Function returns…
A: To Do: To write the C++ Code.
Q: I need a function that takes in a string& and returns a void that outputs a string with "my" at…
A: Note: Comments have been added in the source code itself to have a better understanding of the code.…
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 C++ function to take a string as parameter and return an integer which is the length of…
A: Write a C++ function to take a string as parameter and return an integer which is the length of…
Q: Write a program which requests two lengths in feet and inches (both whole numbers) and prints the…
A: I give the code in C# as per your requirement along with output and code screenshot
Q: Write a progam that reads a string and outputs the number of times each lowercase vowel appears in…
A: Answer. A program that reads a string and outputs the number of times each lowercase vowel appears…
Q: Write a function named sumDigits which takes three parameters: f, t and x. sumDigits, then, finds…
A: Code def sumDigits(f,t,x): for i in range(f,t+1): sum = 0 for digit in str(i):…
Q: Write a function that counts and returns the number of vowels in a word. The function's one…
A: Given data is shown below: Write a function that counts and returns the number of vowels in a word.…
Q: Write a function where you have to find the 3* number of occurrences of character 'h' in the given…
A: We have to write a function that returns 3 times the number of occurrences of character a in string…
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 character-valued function named convertToGrade that has a single type int parameter named…
A: The problem is based on finding the grade of the entered marks from the user.
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 called translate_to_italian () that takes a string as a parameter (a colour).…
A: # Python program to convert color in English to Italian word List=["Verde","Viola","Rosa","Argento"]…
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 that takes in a string input from the user. The function should then print the…
A: C program: C is a general purpose programming language. It was developed by Dennis Ritchie at AT…
Q: Write a function countDigits() that takes a string as parameter, finds and returns the number of…
A: In Python, isdigit() method is used to checks whether the string consists of digits or not. It can…
Q: Write a function called translate_to_italian () that takes a string as a parameter (a colour).…
A: #you didn't specified the language. So i wrote in Python language. def translate_to_italian(colour):…
Q: Write a function that take in a string as the parameter and return the number of character in that…
A: Here no language is mentioned so I have given C program for this question.
Q: Write a function that takes as a parameter an integer (as a long long value) and returns the number…
A: Program code: //include the required header files #include <iostream> using namespace std;…
Q: Write a program that prompts the user to input a string. The program then uses the function substr…
A: code:-
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 function named prntstr that receives a string as parameter from the caller The function will…
A: Algorithm: We will use two loops. for(int i=0;i<strlen(str);i++) for(int j =…
Q: Andrew likes the topic of strings a lot and tries to solve as many problems as he can on this topic.…
A: The sequence of characters is called string and the sequence which can be made out of string is…
Q: Write a function curconv() that takes as input: 1. a currency represented using a string (e.g.,…
A: the answer is given below:-
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, reverseDigit, that takes an integer as a parameter and returns the number with its…
A: Reverse digit function
Q: please code in python Write a function that receives a string as an input and returns the most…
A: When it is required to find the most frequent character in a string, an empty dictionary is created,…
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…
Write a function that gets a string as a parameter and reports (prints out) the number of lower case and upper-case characters in the string. The output should look like
Your string has 200 characters, 120 of them are lower case and 25 of them are upper case alphabet letters.
The allowed length for the string is 200
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- 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 takes in input as a string. For all characters which are numeric, double its value and, if it istwo digits, then replace it with the sum of its digits (e.g., 6 12 3 whereas 3 6). For all characters which arein uppercase, replace it with lowercase. For all characters which are in lowercase, replace it with (e.g.,m M and N n). The program should keep asking the user to enter strings until they either enter 'q' orWrite 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)…
- 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.please code in python Write a function that receives a string as an input and returns the most frequent letter from the given string. Your solution should be case insensitive, so a capital letter (like A) and its non-capital version (a) should be counted as the same letter. In the given string there can be spaces as well, but your solution shouldn’t count spaces. If there are multiple letters with the same occurrence, you can decide which one to return.Write a function named sumDigits which takes three parameters: f, t and x. sumDigits, then, finds the smallest integer between f and t (both inclusive) whose sum of digits is x, and returns that integer.
- Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is “hello. my name is Joe. what is your name?” the function should return the string “Hello. My name is Joe. What is your name?” The program should let the user enter a string and then pass it to the function. The modified string should be displayedWrite 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, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed. For example, reverseDigit(12345) returns 54321, reverseDigit(2300) returns 32, and reverseDigit(-324) returns -423.
- Write a function getSSANum() that takes no parameters, but prompts the user to enter a Social Security number, and returns a string representing a formatted version of the first valid number entered by the user. A valid Social Security Number has precisely nine digits and does not contain any other characters. The formatted version that is returned by the function should look like: xxx-xx-xxxx where the x’s represent the digits entered by the user. The user should be repeatedly re-prompted by the function until they enter a string consisting of precisely nine valid digits. Hint: Assign the information from the user as a string and use string functions (len(str) and string method str.isnumeric(str) to determine if the user input is all numeric) to help you determine if what the user entered has the right format. Note the correct solution to this function will involve a while loop (so check the lecture notes 8-2 to refresh on how while loops operate), because the user is entering a…Write a python function that takes a string as an argument. Then converts this string using the following three rules and finally RETURNS a new string to the function call. If the string is one character long, leave it alone. If the string ends with a vowel (a, e, i, o, u), just add ‘yay’ to the beginning of the string. (e.g., “apple” => “yayapple”) Otherwise, the last letter of the string is moved to the front and ‘ay’ is appended to the end (e.g., “dalek” => “kdaleay”) Assume, the argument string will always be in lowercase letters without any spaces. [ You cannot use slicing. You cannot use any built-in functions except input(), len(), split(), list.append(). ] ================================================ Function call1: function_name("b") Sample Output 1: b Explanation 1: Here, the length of the string is 1, so no modification was done to it. ================================================ Function call2: function_name("apple") Sample Output 2: yayapple Explanation…Write a Boolean function called contains_whitespace() that accepts a string as a parameter and returns True if the string contains one or more whitespaces (" ", "/t", "/n") characters, or False otherwise. Write a main() function to demonstrate how it works.