Question 1 Write a function that takes twɔ integers and returns the value that is greater. If the two integers are equal, return the string “The numbers are the same."
Q: Write a function called greeting that takes a String argument called name, and returns a String that…
A: Kindly Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
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: Question 8: Write a function that takes a number and returns the largest digit value in the number.…
A: GIVEN: Create a python program that returns the largest digit in a number. SAMPLE INPUT AND…
Q: my_func is a function as follows. What is the value of a at the end of the code beneath? function a…
A: answer is
Q: Write a function that parses a decimal number into an octal number. The function header is as…
A: The decimal number is represented as base 10 (0 to 9) and the octal number is represented in base…
Q: Write a function which accepts the user’s first and last name and prints the first name 4 times…
A: Note: The programming language is not mentioned in the question so python programming language is…
Q: Part A: Write a function that calculates the cube of a number by calling another function that…
A: Task :- Write a program to calculate the cube of a number by calling another function calculating…
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: Title .Write a function that take a angle in degree and return tan(x) in java
A: import java.util.*; // Compiler version JDK 11.0.2 class Main{ public static void main(String…
Q: 1- Write a function that finds the max of three numbers that are passed to it.
A: Step 1: input three user input number. Step2: Add three numbers to list. Step 3: Using max()…
Q: Write a function definition for a function named getFirst that does the following: 1) Accepts an…
A: Required: In C++ Write a function definition for a function named getFirst that does the…
Q: I want answer in C Language Write a function to convert temperature from Fahrenheit to Celsius…
A: Define the function "ConvertFtoC( )" and passing the one double value for fahrenheit argument.…
Q: How can we pass argument to a function by reference instead of pass by value?
A: When supplying reference t to the method it will not directly pass the actual reference value of…
Q: A function that produces a table of the numbers from 1 to 10, their squares, and their cubes. No…
A: EXPLANATION - A function named as func is created . In function a for loop is created where value…
Q: C++ please. Define a function PrintColors() that takes three string parameters and outputs as…
A: Step-1: Start Step-2: Declare three variables str1, str2, str3 Step-3: Take input for str1, str2,…
Q: If a function is supposed to just display a message, which is more appropriate to use--a…
A: A function is a set of code which is written once and can be used multiple times by calling it in…
Q: C++ please. Define a function PrintColors() that takes three string parameters and outputs as…
A: I have provided C++ CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: Write a function that takes a number and returns the largest digit value in the number. For example,…
A: The python program is written where it takes the input from the user and prints the largest number.…
Q: Write a prototype for the following function, then a statement that calls the function: void…
A: #include<iostream> using namespace std; void sayHello(); // function…
Q: Write a function NumberOfPennies() that returns the total number of pennies given a number of…
A: I give the code in Cpp along with output and code screenshot
Q: Write a function to convert temperature from Fahrenheit to Celsius named “Convert F to C” that takes…
A: As no programming language is mentioned, it is solved using basic C++
Q: 2. Write a function named “MyInfo ()". Now pass three parameters to your function i.e. your name,…
A: Please find the answer below :
Q: Part B: Write a function using pass by reference that swaps the values of the two variables but this…
A: Required:
Q: Write a function to convert temperature from Fahrenheit to Celsius named “ConvertFtoC” that takes…
A: Given: Write a function to convert temperature from Fahrenheit to Celsius named “ConvertFtoC” that…
Q: (2) Write a program include two functions, the first is named fact receives one integer and returns…
A: Start Program to get the Sum of series: 1 + x^2/2! + x^4/4! -…. upto nth term Find the factorial…
Q: Task 1 Write a function called even_checker that takes a number as an argument and prints whether…
A: Code: n=int(input("Please Enter a number: "))#taking user inputdef even_checker(n):#function to…
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: 1. Write a function called showNumbers that takes a parameter called limit. It should print all the…
A: Task :- Write a python program for given question. Python program :- def showNumbers(limit):…
Q: Write a function that takes 3 int arguments and returns the largest of the 3.
A: Write a function that takes 3 int arguments and returns the largest of the 3.
Q: Write a function that takes two string parameters and their common length. It fills out the second…
A: We have to complete a function "toCapital" which takes two string parameters and their common…
Q: (2) Write a program include two functions, the first is named fact receives one integer and returns…
A: Here the language of coding is C++ #include<bits/stdc++.h> using namespace std; typedef long…
Q: Task 4 Write a python function that takes a string as an argument. Your task is to calculate the…
A: # Defining a Function [ Up_Low(Mystr) ]to take string as argument def Up_Low(Mystr): up = 0 #…
Q: Examine the following function header, and then write a statement that calls the function, passing…
A: The statement that calls the function:- show_value(12) Example program code:- #Function which takes…
Q: Write a function that displays the changes in a given amount of dollars. void displayChanges(double…
A: C program to solve the given problem is below.
Q: 2. Code the given function and test it inside the main function. int Length(char* str) { //…
A: // Using C program to print the length of the string using pointers…
Q: Write C++ funtion GCD(int a, int b) having single line of code only in the function. Don't answer…
A: Given: Write C++ funtion GCD(int a, int b) having single line of code only in the function. Don't…
Q: When passing a variable to a function how should the variable be passed? a. Variables can't be…
A: There are two ways to pass a variable to a function. ByVal and ByRef.
Q: What value will be returned by the function if a = 8, b=12? int func(int a, int b){ if(a>b){ return…
A: Find the value returned by the given function named "func" if the parameters are a=8 and b=12.
Q: Create a function that takes two integers, num and n, and returns an integer which is divisible by n…
A: function roundNumber(num, n) { let i = num, j = num while (i % n !== 0) i++ while (j % n !== 0…
Q: Write a function to convert temperature from Fahrenheit to Celsius named "ConvertFtoC" that takes…
A: The required C program code is: #include <stdio.h> double ConvertFtoC(double F) /* function…
Q: Write a function tuplinator (number) that takes a number argument and returns a tuple consisting of…
A: ALGORITHM:- 1. Create an empty tuple. 2. Insert the received number, its square and its cube in the…
Q: Modify the code you had previously so that the function print_bill outputs the actual names of the…
A: The Answer is
Q: How to make a function return multiple values?
A: As per the question statement, We need to list the ways using which we can return multiple values…
Q: Write a function that multiples at least three numbers that you pass it as arguments and that has at…
A: Please refer below code and output: Language used is R Multthreenumber <- function(a,b,c) {…
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: QUESTION 8 When the arguments in a function must be in the same order the parameters were written,…
A: An argument is a variable, value or object passed to a function or method as input. Positional…
Q: Q3. * The return-value-type of a function is . if it does not return any value. O float O char O int…
A: void is a type which is returning nothing, when return value of any function is void, then it return…
Q: int ffc(char &x) is a function with parameter passed by reference
A: int ffc(char &x) is a function with parameter passed by reference syntax IN Parameter Pass By…
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.…
Use python
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- (Numerical) Heron’s formula for the area, A, of a triangle with sides of length a, b, and c is A=s(sa)(sb)(sc) where s=(a+b+c)2 Write, test, and execute a function that accepts the values of a, b, and c as parameters from a calling function, and then calculates the values of sand[s(sa)(sb)(sc)]. If this quantity is positive, the function calculates A. If the quantity is negative, a, b, and c do not form a triangle, and the function should set A=1. The value of A should be returned by the function.Mark the following statements as true or false: a. To use a predefined function in a program, you need to know only the name of the function and how to use it. (1) b. A value-returning function returns only one value. (2, 3) c. Parameters allow you to use different values each time the function is called. (2, 7, 9) d. When a return statement executes in a user-defined function, the function immediately exits. (3, 4) e. A value-returning function returns only integer values. (4) f. A variable name cannot be passed to a value parameter. (3, 6) g. If a C++ function does not use parameters, parentheses around the empty parameter list are still required. (2, 3, 6) h. In C + + , the names of the corresponding formal and actual parameters must be the same. (3, 4, 6) i. A function that changes the value of a reference parameter also changes the value of the actual parameter. (7) j. Whenever the value of a reference parameter changes, the value of the actual parameter changes. (7) k. In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function. (9) l. Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided. (10) m. In a program, global constants are as dangerous as global variables. (10) n. The memory for a static variable remains allocated between function calls. (11)(C++) Question: Write a function string middle(string str)that returns a string containing the middle character in str if the length of str is odd, or the two middle characters if the length is even. For example, middle("middle") returns "dd". I'm not getting the correct output. What am I doing incorrectly?
- 2. Code the given function and test it inside the main function. int Length(char* str){ // return the length of string str //write your code here}Write the function strend (s ,t ), which returns 1 if the string t occurs at the end of the string s, and zero otherwise.Write a function that takes 4 integers (num1,den1,num2,den2) as parameters which represent the rational numbers num1/den1, num2/den2 and returns the addition of these two fractions. A/B + C/D = AD +BC/BD • den1, den2 can not be zero. • use simplify function.
- Please help me with my homework, in computer programming as follows: A number, a is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if a is a power of b. Note: you will have to think of the base case.I want answer in C Language Write a function to convert temperature from Fahrenheit to Celsius named “ConvertFtoC” that takes one double value for Fahrenheit as argument, and returns the equivalent temperature in Celsius(type double). Create a program that exercise this function by obtaining a Fahrenheit value from the user, calling the function, and displaying the value of Celsius it returns. [Formula: Celsius = (Fahrenheit – 32 ) * 5/9 ]Write a function in_out (xs, ys, side) which takes three numbers as input, where the side is non-negative. Here xs and ys represent the x and y coordinates of the lower left corner of a square; and side represents the length of the side of the square. (Note that xs, ys and sides completely define a square and its position in the plane). Your function must first prompt the user to enter two numbers that represent the x and y coordinates of a point request. Your function should display True if the given query point is inside of the given square, otherwise it should display False. A point on the limit of a square is considered as being inside the square. No loops, no ifs, no lists To avoid confusion, unless otherwise noted in the questions, here is what you can use in these exercises: - comparison operators: <, <=, ==,! =,>,> = - Boolean operators: and, or, not - arithmetic operators: +, -, *, /, **,%, // - the following Python built-in functions: print, input, round, len,…
- Write a function fune/2 which has two arguments and returns true, if the two arguments are equal, and false, otherwise. For example, fune (2, two)==false.Write the definition of a function that takes as input the three numbers. The function returns true if the first number to the power of the second number equals the third number; otherwise, it returns false. (Assume that the three numbers are of type double).I need a function that takes in a string& and returns a void that outputs a string with "my" at the beginning such as "Boat" becoming "my Boat". Please help me with this problem using c++.