Write a function is_palindrome(...) that returns a Boolean indicating whether a C-style string is a palindrome. Notice that is_palindrome(..) accepts two parameters: a_first that is a pointer to the first character, and a_last points to the '\0' character in the C- style string. Note: you may use pointer arithmetic if you wish here.
Q: How to create a function str_asterisk() that takes a string of five words, and returns a list of…
A: 1) Since you have not specified the programming language I have written program in python 2) Below…
Q: Please finish function between. Function between have two parameter a and b which are both the…
A: & is used to find the address * is used to fetch value from passed address
Q: Question 2: Write a function called number_matrix(r,c) that takes two parameters r and c and PRINTS…
A: In given problem it has been asked to write a function number_matrix(r,c) that takes two parameter r…
Q: Write a Function in C++ to find swap two numbers that entered by user using pointer .
A: Given:- Write a Function in C++ to find swap two numbers that entered by userusing pointer .
Q: In C++, Write a function that receives a string of characters and return true if the string is in…
A: A program is to be written in a C++ language. The program can be compiled on any one of the online…
Q: Write a function validate_date(date_string) which takes in a datestring and checks if the datestring…
A: Given The answer is given below.
Q: Write a function that accepts a person's full name (consisting of exactly two words separated by…
A: I have provided C CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: I need a memory diagram of this C++ function: ***CODE*** #include using namespace std; int f2(int r,…
A: Memory diagram of the given code: #include <bits/stdc++.h>using namespace std;int f2(int r,…
Q: Write a function named “duplicateWithoutBlanks” that accepts aC-string of characters. It will create…
A: Step 1: Declare Char array using New operator Step 2: Accept string in character array Step 3: Call…
Q: рythoh, cr a argui bê a list O tuples. If the value in data is an even number, return 0. If it is…
A: # Python Code ``` ans1 = [] ans2 = [] def convert_values(data): #initialising counters to…
Q: I am doing a word guessing game where I have created a function that shuffles a word randomly.…
A: Jumbled word is given to player, player has to rearrange the characters of…
Q: Write a program to find the sum of all non-prime numbers from m and n (including m and n also) using…
A: PROGRAM: #include <stdio.h> //Required function void calculate(int *s,int *e,int *sum){…
Q: Ask the user to enter the following statement: "I like programming in C++ because C++ is fun and…
A: #include <bits/stdc++.h> using namespace std; #define int long long int int Count(string s…
Q: Write a function that will take a pointer to a null-terminated string of const char as input and…
A: #include <stdio.h> int countAsterisk(char *str){ char *ptr = str; int count = 0;…
Q: c programming Write a function f which takes three pointers to int variables (a, b, c). Then it…
A: #include<stdio.h>int max(int a,int b,int c){ // compute maximum of 3 numbers return…
Q: The caret, when found at the start of a character set, is the equivalent to "not" in RegEx. The…
A: I give the code in Python along with output and code screenshot
Q: Using the function from the previous problem, write a function durdle_game(target) which takes in as…
A: Please find the answer below :
Q: C++ : .Write a function that, given two strings, creates another string that contains only the…
A: Code: #include<iostream>using namespace std;#include <string>void func(string s1,string…
Q: Write a code Using Pointers that can print a table of values for coordinate points (x,y) for a given…
A: We need to write a C program using pointers to compute n points using y=mx+c.
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: Write a function to replace all instances of character c1 with character c2 and vice versa. Examples…
A: function doubleSwap(str, c1, c2) { let newstr = ''; for (let i = 0; i < str.length; i++){ if…
Q: write a function named largestTwo that will take vector of integers as parameter and will print the…
A: I give the code as per your requirement in C++ along with comments and output and code screenshots…
Q: Make a function that would accept a float pointer variable and round off the number to its…
A: The program is written in C. Check the program screenshot for the correct indentation. Please check…
Q: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string. For…
A: GIVEN: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string. For…
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: In C++, Write a function named that accepts argc and args with the same data type as command line…
A: Answer: C++ Source Code: #include<iostream> int size(char * arg){ int i=0; while (arg[i] != 0)…
Q: Write a function called subsequence() that finds the longest common subsequence of two DNA strands.…
A: Program explanation: Declare the header files Declare and define the function to calculate the…
Q: The findStr Function mplement your version of the standard C-library function strstr(). So that it…
A: Answer: I have done code C .and also I have attached C code and code screenshot and output.…
Q: Create a function that takes two integers, num and n, and returns an integer which is divisible by n…
A: As no programming language is mentioned, it is solved using basic Python
Q: By using C , void fun(void* a, char*b) Write a defination of above function that accepts a…
A: pointers: pointers in c which will store the address of another variable , it used to refer another…
Q: Write a Function in C++to find the maximum between two numbers that entered by user using pointer
A: #include <iostream> using namespace std;void func2(int x,int y) {int…
Q: Write a function longestRun($str) that takes a string as a parameter and returns the length of the…
A: The answer is
Q: Study the following definition of function "Secret" and answer the question below. int Secret (int…
A: complete code: //include the header#include <iostream>using namespace std; //method…
Q: Write a user-defined function that compares two string with each other. If first one is equal to…
A: Function definition: A function is a subroutine that executes a set of instructions or a set of…
Q: Given the definitions of myChars and myCopiedChars below, write a function in C which is capable of…
A: Code in C language: #include <stdio.h> #include <stdlib.h> #include <string.h>…
Q: Write a function called multTable that returns void, takes in an int row and, int col and prints the…
A: The program prompts the user to enter row index and column index till which the multiplication table…
Q: Please help language = C++ Write a function equalsIgnoreCase, which receives two char arrays…
A: Conversion from the upper case to lower case of an alphabet: A character is said to be the upper…
Q: Complete the below function which takes an integer k and a string s as its arguments and returns a…
A: The program takes two inputs from the user such as integer value of k and string s. k is the int…
Q: Write a function replaceVowels() with no return value to replace all the vowels (A, E, I, O, U) that…
A: Each of the vowel must be replaced an that too original string So, we use pass by reference
Q: 5. Write a Python function that takes two paramters. A sentence and a word, then returns the…
A: Python program to solve the given problem, A screenshot of output and code are also attached for…
Q: pandas DataFrame, col
A: Given as, def calc_mean_mode(df, column_name): # your code here return calc_mean_mode(df,'Age')…
Q: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string. For…
A: Required: Write a C++ function named dup that makes a copy of a C-string but repeats the C-string.…
Q: Write a function whose prototype is void exchange(int *p, int *q);that takes two pointers to integer…
A: Write a function whose prototype is
Q: Write a function named “hasHelpOption”that accepts argc and argv (same data typesof command line…
A: bool hasHelpOption(int argc,char **argv){ for(int i=0;i<argc;++i) {…
c++problem
Step by step
Solved in 2 steps with 1 images
- The program will ask the user for their name and employee ID. The ID will be a five-digit number. This will be done in a single function, AskNameId, with bool return, where the name and id are passed as pointers. Read both variables as strings with a getline and convert the id to an int using atoi. Check that the id is not 0. If it is, cout a message to the user for entering an invalid id. Check if the name is an empty string. If it is, cout a message to the user for entering an invalid name. Return a bool, true if name and id are both valid and false if either one is not valid.Write a function that will take a pointer to a null-terminated string of const charas input and will return the number of characters in the string that are the asteriskcharacter (‘*’). For full credit your routine should use pointers in the proper way(with no index or counter) C Programming Please!Write a function called multTable that returns void, takes in an int row and, int col and prints the multiplication table from 1 up to the two integers. For example, a call to this function like... multTable(3, 5) prints… 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 Please help me with this problem using c++.
- 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):Please answer it in Python Write a double_consonant function , It takes a word as a parameter and has two return values : A Boolean value equals True If the word contains a double consonant ( The same consonant twice in a row ), under these circumstances , The second value returned is the double consonant ; If there are no double consonants , Function should return False and None. relevant information : To simplify the exercise , We don't use words that contain multiple double consonants ( for example ,“successor”) Test your functionality on . Example : double_consonne('arrivee') vaut True, 'r'.double_consonne('bonbon') vaut False, Nonedouble_consonne('reussite') vaut True, 's'Write a function in python that takes an acrostic as the input and will return the secret message to the user. Include optional arguments to state what makes the first line, as well as what position should be used.a) SATOR\nAREPO\nTENET\nOPERA\nROTAS\n1. Use each index position 0 through 4 b)Elizabeth it is in vain you say\t“Love not” – thou sayest it in so sweet a way:\tIn vain those words from thee or L.E.L.\tZantippe’s talents had enforced so well:Ah! If that language from thy heart arise,\tEndymion, recollect, when Luna tried\tTo cure his love – was cured of all beside\tHis folly – pride – and passion – for he died.“An Acrostic” by Edgar Allen Poe
- Write a C++ function named louder which accepts a pointer to a C-string as its argument. It should do 3 things: - change any period (.) in the C-string to an exclamation point (!) - change any lower case letter in the C-string to the corresponding upper case letter - return the number of characters which were changed You may assume that parameter str points to a valid, null-terminated C-string containing only alphabetic characters, spaces and periods. You do not need to demonstrate calling this function. Example: if str points to an array containing "Giants win." the function should change the array so that it contains "GIANTS WIN!", and should return 9. You must use this function signature: int louder(char *str)You must answer the Problem in C++. (Anagrams) Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order. For example, “silent” and “listen” are anagrams. The header of the function is as follows: bool isAnagram(const string& s1, const string& s2) Write a test program that prompts the user to enter two strings and checks whether they are anagrams. Sample Run 1 Enter a string s1: silent Enter a string s2: listen silent and listen are anagrams Sample Run 2 Enter a string s1: split Enter a string s2: lisp split and lisp are not anagramsWrite a C++ function named getLowerAlphabets that takes a C-string argument and returns a C-stringmade up of the lower alphabet characters of the argument. If none of the characters of the argument is alower alphabet then you must still return a C-string which is obviously empty C-string; that is a C-stringwith only the null character.
- Write a function called NextCell that takes a string as argument, (i.e., Address of the cell,) which should look like the address of a cell such as C2. The function should return True or False depending on whether the cell to the right of this one contains a formula. For example, if you pass C2, it checks whether D2 contains a formula.Write a function called myFind which accepts a 2 strings as parameters (tmp and strToFind) and returns the location of the first occurrence of strToFind in tmp . You may NOT use Python’s built-in find OR rfind OR index functions.PLease! in c++ Write a function named “getNonNegativeSum” that takes in 4 input parameters: -a pointer to thearray of integers-its size, -the index tostart the sum from -the count of how many numbers from that starting index It will return the sum of all values from the startingindex with the number count of how many. It will add to the sum if the number in the array is positiveand skip all negative values. If there is an error in the indexor not enough numbers to count, it will return -1. For example,int numList[] = {10, 20, -1, 30}; If the starting index is 1 and the count of 3, it will return 50 If the starting index is 2 and the count of 2, it will return 30 If the starting index is -1 and the count of 2, it will return -1 If the starting index is 2and the count of 5, it will return -1.int priceList[] = {10, 20, 30, -1, 40}; If the starting index is 0, and the count is 1, it will return 10 If the starting index is 1, and the count is 3, itwill return 50 If the starting index is 0,…