Let's write a C++ program function named toFrenchGender() that takes the French name of a country and returns the name with the appropriate article added
Q: Write a C++ program that would implement the function called filterString which accepts a string s…
A: Filtering number from given string using c++
Q: Write a program in C Write a function calledsum_average()whichtakesthree input parameters (x,yand…
A: #include <stdio.h> void sum_average(float a, float b, float c, float* sum, float* average) {…
Q: Write a program in C++ with total change amount as an integer input that outputs the change using…
A: A C++ program for the given criteria is as follows, File name: “main.cpp” #include <iostream>…
Q: Write a C program that creates a security access code from a social security number entered by a…
A: // stdio.h is the C standard library it is a header file stdio.h which stands for standard…
Q: Write a c++ program: Write a function named convertToLowestTerms that inputs two integer parameters…
A: Program code: //include required header files #include<iostream> using namespace std;…
Q: Based on the function definition below, write a complete C program with implementation of functions:…
A: Solution :
Q: Write a C++ program that includes the following function: a boolean function with the name of…
A: #include<iostream>using namespace std;//boolean function to check number is even or odd//if…
Q: write and upload the C++ code for the function Fabonacci(k)=Fabonacci(k- 1)+Fabonacci(k-2), when…
A: Required
Q: Write a function in C language that takes the time as three integer arguments (for hours, minutes,…
A: According to the information given:- we have to write c program to take 3 integer argument for…
Q: Write a function in C++ that takes a string as a parameter and replaces all the digits in the string…
A: //Import iostream and cctype#include <iostream>#include <cctype> using namespace std;…
Q: Write a program to read a sequence of integer numbers until it enters a negative number, then prints…
A: I give the code in C++ along with output and code screenshot
Q: In C language, implement the function that gets a string str, changes all digits of str to 0 (zero),…
A: To implement a function in C that will convert all numbers in a string to 0 and count the converted…
Q: Investigate the math library in C and write a function in C called mather which takes a double value…
A: Before going to code we have to add the math library in our header file. Syntax:…
Q: Q2/I write a program in C++ language to read a certain angle and determine the affiliation of that…
A: User gives two inputs(x & y coordinates). The inputs are stored in two int type variables say x…
Q: Write a C++ program that finds either a user given number is Armstrong or not. If it is Armstrong…
A: Below is the required C++ program: - Approach: - Include the header file and use the namespace.…
Q: Write a complete C program that inputs a line of text and a search string from the keyboard. Using…
A: Objective: This program would read a line of text from the user along with a search string (a word)…
Q: Q2 / I write a program in C ++ language to read a certain angle and determine the affiliation of…
A: A rectangular coordinate system built up of of x-axis and y-axis dividing a plane into four…
Q: Write a function in C++ that receives an integer number and prints out a random number between one…
A: Code #include<iostream>#include<cstdlib>#include<time.h>using namespace std;int…
Q: Write a program in c++ to insert a 9-digit variable and make 9-digit commas In a function alone, and…
A: /* * Prompt user for two integers and print their sum, difference, product and quotient *…
Q: Write a function in JAVA language that accepts three integer parameters and returns true if two or…
A: Testing the program using modular to solve this
Q: Write a program in c++ to insert a 9-digit variable and make 9-digit commas In a function alone, and…
A: /* * Prompt user for two integers and print their sum, difference, product and quotient *…
Q: Write a program function (in any programming language) that will find and add 3 digits odd numbers…
A: A cyclomatic complexity is the measurement that is being correlated to a number of coding errors.…
Q: Write a C++ program that would implement the function called romanToInt which returns the integer…
A: - We have to code for the conversion problem.
Q: Q2 /I write a program in C++ language that converts the temperature from F to C using the concept of…
A: #include<iostream>using namespace std;int main(){ float C,F; cout<<"Enter the…
Q: Write a C++ program that reads a sentence into a c-string of maximum 80 characters, a character into…
A: In this programming question we have to develop a code, using C++ program in which we ask User For…
Q: Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your…
A: Given: The Palindrome string/text is a special sequence and it will be same while reading from left…
Q: Write a C# class Factors having function static int CountOddFactors(int n) that would return count…
A: Task :- Write a C# program to count the number of odd factors for given number. C# program :-…
Q: 1. Based on the function definition below, write a complete C program with the implementation of…
A: Given: based on the function given write complete C program with implementation of functions.
Q: Write a C-program, which reads five English words in the following order, an article (A/An/The), a…
A: Below is the required C program: - Approach: - Import the header files. Define the main function.…
Q: Write a C++ Program using using classes, that, given a number greater than zero (0), the user will…
A: The complete code is a given below .
Q: Write a C program that reads a one-digit number and then displays it to the screen as a word in…
A: To read a single-digit we need to scanf a character (%c) and convert the char to int by subtracting…
Q: write a program in C++, that should demonstrate a value returning function. Ask the user for their…
A: Input : Name of user Type of ice Number of toppings Output : Total price for the ice cream.
Q: write a program in c++ Language that require from user to insert the total number of students and…
A: #include <iostream> using namespace std; int main(){ //Variable declaration float…
Q: Write a program in C programming language that takes two arguments at the command line, both…
A: #include<stdio.h> int main() { char string[80], searchString[10]; int count1 = 0,…
Q: First: Write a program in C++ by using function overloading that multiply: Two integer numbers Two…
A: Function Overloading: Multiple functions have the same name but different parameters are called…
Q: Using a C language, write a C program that will display the menu as shown below and will ask the…
A: //Textual Source Code :- #include<stdio.h>#include<conio.h> //for cardinal no.of set =…
Q: Write a program in C to find vowels in a string s1 and concatente those vowels with string s2 in…
A: Program code: //included header file#include <stdio.h>#include <string.h>//function…
Q: Write a program in c++ that enters two statements from the keyboard as follows: The first phrase: is…
A: Sample output
Q: 1. Write a complete C program that reads the temperature of five cities in the last week then print…
A: Please give positive ratings for my effort. Thanks. PROGRAM…
Q: Write a program in C++ to read a sequence of integer numbers until a negative number is entered,…
A: Input the numbers in a vector. Create a function to find and print the sum of numbers in the vector.
Q: A program in the C language that receives from the user an actual number up to 3 digits after the…
A: #include<stdio.h>#include <math.h>void main(){ double num = 0.0; printf("Enter a…
Q: In the C program, I am trying to create a function that will separate a string by storing the two…
A: The question has been solved in step2:
Q: Write a program in C language to simulate tossing a “fair” coin. Allow the user to enter the number…
A: Write a program using c language that will take a number of tosses as input and find the number of…
Q: Write a c++ program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your…
A: #include <iostream>using namespace std; bool isPalindrome(string str){ int n =…
Let's write a C++ program function named toFrenchGender() that takes the French name of a country and returns the name with the appropriate article added: le for masculine or la for feminine, such as le Canada or la Belgique. However, if the country name starts with a vowel, use l’; for example, l’Afghanistan. And, for another wrinkle, use les for plural country names. A name is plural if it ends in es, is, as, or os, or, if the first word in the name is iles, or "islands". Finally, the following countries do not have a preceding definite article (le or la): Israel, Madagascar, Sri Lanka, Singapore, Monaco, Cuba and Cyprus.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 8 images
- Write a C++ Program that calculates the area and perimeter of an upright rectangle.Create a struct Point that has two double values, x and y. Write a function that asks the user for a Point.Call that function twice, once to get the bottom left corner of a rectangle, and once to get the top right corner.Write another function that takes two Points and returns area and perimeter. Print out the area and perimeter.Given two points (x1, y1) and (x2, y2), the formulas to compute perimeter and area are as followsPerimeter = 2 ∗ (abs(x1 − x2) + abs(y1 − y2))Area = abs(x1 − x2) ∗ abs(y1 − y2)Write a program in C++ using libraries. Write a function that allows case-insensitive comparison of two strings. The return value should be analogous to that from strcmp: s1 < s2 return something < 0 s1 == s2 return something == 0 s1 > s2 return something > 0 (These return values can be short integers.) Just remember that the comparisons are to be done in a manner that ignores the caseof the letters in the strings! But also note that the strings should not be altered at all. Don't change the two string arguments before or during the call. Don't make copies and change the copies. All of this is terribly wasteful and/or destructive of data. Place your new function in a library (strextra?) and call it something useful (strcmp_ncase?). Write a driver program to test your function.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 c++ program in which function drawLine(int x, int y) in the above code. this function should return length of lines in main i.e subtracting y from x.Write a program in c++ that calculates the area and perimeter of an upright rectangle.Create a struct Point that has two double values, x and y. Write a function that asks the user for a Point. Call that function twice, once to get the bottom left corner of a rectangle, and once to get the top right corner. Write another function that takes two Points and returns area and perimeter. Print out the area and perimeter. Given two points (x1,y1) and (x2,y2), the formulas to compute perimeter and area are as follows P erimeter = 2 ∗ (abs(x1 − x2) + abs(y1 − y2))Area = abs(x1 − x2) ∗ abs(y1 − y2)write a program in C++ that A user needs to determine the size of squares (let say delta) in a grid, the center of the circle (does not have to lie on a grid but it can!) and the radius. (for example use "cin>>" ) Then you need to plot a circle using parametric equations of circle (you need to increase angle and plot these (in my picture black) points). First plot the first point of the circle and determine in which square of grid it is. (in my picture it is an orange square) and plot the left bottom vertex of this square (in my picture it is a blue point). Then increase an angle and plot next point of circle - check if it lies in different square. -If it is not in different square, you need to increase angle and check again. (because an angle was too small) -If it is the different square, then check, if this square has THE COMMON EDGE with the previous one -> if it has the common edge, then print new left bottom vertex of this square (if does not have common edge,…
- In the C program, I am trying to create a function that will separate a string by storing the two parts of the string in two variables. The string is randomly selected from the text file and for example if the string is " Halloween - A holiday", I want the string to be separated on the basis of '-'. So the first string would be separated as "Haloween" and the second string would be stored as "-A holiday". The string could have any content but it should split based on the '-' and then the two strings should be stored in the two varaiblesWrite a c++ program: Write a function named convertToLowestTerms that inputs two integer parameters by reference named numerator and denominator. The function should treat these variables as a fraction and reduce them to lowest terms. For example, if numerator is 20 and denominator is 60, then the function should change the variables to 1 and 3, respectively. This will require finding the greatest common divisor for the numerator and denominator then dividing both variables by that number. If the denominator is zero, the function should return false, otherwise the function should return true. Write a driver program that uses convertToLowestTerms to reduce and output several fractions.Write a lisp function that prints out the calendar for the current month. This function should take 2 parameters: the day of the week that the month starts from as an index (0 for Sunday, etc.) and the number of days in the month. For example, if you call the function (calendar 2 30) Print the initial of each day on the first line using the list of days defined at the previous exercise, the capitalized symbol-name as before, and the function substring to extract the first letter of the string. For example, the call: (substring "Sunday" 0 1) returns the string "S".
- Implement in C Programming 6.6.3: Function with loop: Shampoo. Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N: Lather and rinse." numCycles times, where N is the cycle number, followed by "Done.". End with a newline. Example output with input 2:1: Lather and rinse. 2: Lather and rinse. Done. Hint: Declare and use a loop variable. #include <stdio.h> /* Your solution goes here */ int main(void) { int userCycles; scanf("%d", &userCycles); PrintShampooInstructions(userCycles); return 0;}Write a program in Python with a function perfectcube(n), which returns True if n is a perfect cube and returns False otherwise. Notice that this function is not printing anything, but rather returning True or False. The function must use exhaustive enumeration to check if n is a perfect cube. Use the function in a program where you ask the user for n and you print a statement like "Yes, that is a perfect cube" or "No, that number is not a perfect cube".Write a C++ program that would implement the function called filterString which accepts a string s that contains numbers and letters mixed up. The function must return an integer corresponding to the numbers in s in the order that they appear. If there are no numbers in s, the function should return 0. TEST CASES: filterString(‘123’) = 123 filterString(‘abc’’) = 0 filterString(‘aa 112 3dd’) = 1123