(4) write two user-defined functions to calculate the area of a triangle, and its sides are a, b and c. area = (s-a)(s-b{s-c) where s= (a+b+c)/2
Q: Write a function that takes three integers namely a, b, and c as parameters. The function should…
A: If you want to accept input from user, you can do it by using scanf() statements or you can simply…
Q: function_1 is a function as follows. What is the value of a at the end of the code ? function a =…
A: Lets analyse the given code: function a = function_1(a)%takes variable a from function…
Q: Construct a program which uses functions for each of the four arithmetic operations. They can be…
A: Actually, program is a executable software that runs on a computer.
Q: 4- Write a function to find the maximum number of 3 entered numbers VB Net
A: 'VB.Net program to find the largest number 'among three numbers. Module Module1 Sub Main()…
Q: Write a code to overload area() function that can find the area of circle, rectangle , triangle and…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: 4. Write a function to compute the following: i.e. the area and perimeter circle as given below. No…
A: import math #to use value of pidef areaperi(r): area = math.pi*r*r perimeter = 2*math.pi*r…
Q: 3- Write a function pow (double base, int exp) to calculate integral powers of floating-point…
A: #include <iostream> #include <cmath> using namespace std; double pow1(double base, int…
Q: Mark the following statements as true or false and correct the second part if false: 1. The…
A: Note: Since you have posted multiple sub-questions in the same request, we will solve the first…
Q: .Write a function absolute(x) that prints the absolute value of x
A: abs(x)- This method returns absolute value of x - the (positive) distance between x and zero.
Q: 6. Suppose, user will provide you the length of 3 sides of a triangle. Now, create a function that…
A: The answer is given below:-
Q: 57) By using call by reference can get more than one output of the user defined function.
A: As per the question statement, It is asked to state true or false.
Q: 7.)Write a fruitful function sum_to(n) that returns the sum of all integer numbers up to and…
A: ANSWER 1: Fruitful Function:
Q: void fun (void) { Consider the following C program. int a, b, c; //definition 1 .. while (. .) { For…
A: Given: void fun ( void ){int a, b, c; //definition 1…while (…){int b, c, d; //definition 2… 1while (…
Q: 2. Given the following function A(a, b), what does A(8, 3) return? 1 function A(a, b) 2 if b = 0 3…
A: code:
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: 6- Write a C++ function to check if a number is a float. The correct float number comes in any of…
A: I have provided C++ CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT-------------
Q: To convert between Celsius and Fahrenheit, the following formula is used, where C = Celsius…
A: In this program, you need to write function called toCelsius() which will convert Fahrenheit…
Q: Define a function Calculate() that performs the following:
A: In this question we are asked to write a C program. Create a function called Calculate() and pass…
Q: ( (7.)Write a fruitful function sum_to(n) that returns the sum of all integer numbers up to and…
A: This question comes from Python Programming Language which is a paper of Computer Science. Let's…
Q: (Use Python) Use the Design Recipe to define a function called black_jack which consumes to 2 int…
A: Answer Python Code : def black_jack(a, b): if a>21 and b>21: return 0 if a>21:…
Q: #13. Let the function fun be defined as int fun (int k) *k + 4; return 3 (*k) - 1; Suppose fun is…
A: a. if the operands in the expressions are evaluated left to the right? given i = 10 then, sum1 =…
Q: 2. If a function have all the default arguments but still some values are passed to the function…
A: Question 2. If a function have all the default arguments but still some values are passed to the…
Q: 1) Write a function declaration for a function named divide: a) Accept two numbers as input…
A: function divide(float num1, float num2): Start return num1/num2 Stop function main: Start declare…
Q: .- Write a void function definition for a function called update_cost. The function has two formal…
A: The program is written in Java. Please find the source code in step 2
Q: a) Explain the operation of the lines commented as lines A -E b) What is the importance of the main…
A: A) Line A:- Declaring varible 'a' of data types 'double' (8 bytes) Line B:- While(1) is an infinite…
Q: /* function definition to swap the values */ void swap(int x, int y) { int temp; return e;
A: /*Program to swap value of x nd y using swap function*/ #include<stdio.h> //swap function…
Q: Please answer it in python using function turtle -Write a polygon(nb cotes.dimension) function that…
A: Algorithm: Start Import turtle and math modules Implement polygon() method which takes no.of sides…
Q: C++ Coding Question, Fill the void function *n1, int *n2, int *n3) void passReference(int ( // Write…
A: Coded using C++.
Q: Write a program that receives a value n and prints the expansion of the binomial (x + y) n. To do…
A: ** THIS PROGRAM IS WRITTEN IN PYTHON SINCE NO PROGRAMMING LANGUAGE WAS MENTIONED** #entry…
Q: C++ Coding Question, Fill the void function *n1, int *n2, int *n3) void passReference(int ( // Write…
A: Coded using C++.
Q: Write a code im c++ to overload area() function that can find the area of circle, rectangle ,…
A: Formula to calculate the area of the circle of radius, r: area=3.0×π×radius×radius Formula to…
Q: 60- In the function, we pass the address of the variable as arguments when using --- O • Call by…
A: C++ program: C++ is a high level programming language. It is the extension of C program. It supports…
Q: 2-Determine the output of the following functions (You must show your works) c. (cdaaddaar…
A: 2-Determine the output of the following functions (You must show your works) c. (cdaaddaar…
Q: Q2 / I write a program in C ++ to calculate the value of the following relationship, using the…
A: Algorithm: 1. Start 2. Read k value 3. Write factorial function to calculate factorial of the number…
Q: 1. Write a function that receives 5 integers and returns the sum, average and standard deviation of…
A: Find Your Code Below
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: a- Write a program to pass two integer numbers as parameters to a function; this function is used to…
A: Here, Code instruction is given.
Q: 9. Write a function that receives marks received by a student in 7 subjects and returns the avera…
A: Program Approach: Include necessary header files to get the standard I/O. Define a function to…
Q: 1- Write a python function that prompts the user for a name, age, and hobby and prints these in the…
A: Python Code: #function that prompts the user for a name, age, and hobby and prints itdef…
Q: d) What is the difference between the following 2 types of functions Operate () Operate (int x)
A: Parameterization is the process of taking values or objects defined within a function or a method…
Q: Local variables used in a function are defined in the parameter list of that functions definition.…
A: A variable is a storage location which hold the value. The variables can be accessed throughout the…
Q: 1)Write a function in Python that takes four parameters a, b, c and n and then checks to see if…
A: python code is given below:
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: Three rectangles have to be drawn in a blackboard. Get the x and y coordinate values of the three…
A: Here we have given the program in c to find the area of the three rectangle with x and y coordinates…
Q: Consider the following function call: min(x, y) What is the function name and what is the first…
A: Please find the answer below :
Q: 1)Why is it appropriate to terminate every statement with a semicolon, even the last one in a…
A: As per guidelines i can answer only one question. For answers of other question please ask…
Q: Write a code to declare a function that calculates the area of a triangle and discuss the parts that…
A: ## As no language is mentioned, we write the code in Python language. def…
Q: Question 4 The correct prototype for the following function heading is void F1(int x], int yO[10]),…
A: Given: A function is given which takes some arguments. Goal: We have to check whether the given…
Q: 1. Write a Python function that takes a number as a parameter and check the number is prime or not.…
A: Required:
Write a C
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.(Practice) The volume, v, and side surface area, s, of a cylinder are given by these formulas: v=r2ls=2rl r is the cylinder’s radius, and l is its length. Using these formulas, write and test a function named cylinder() that accepts a cylinder’s radius and length and returns its volume and side surface area.Write a function that receives 5 integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the results in main(). Y c program h....
- 17. A function should determine the average of x and y. What should be the function's parameters and return value(s)? A.Parameters: none Return values: X,y B.Parameters: ×, y, average Return value: none C.Parameters: average Return values; X, y D.Parameters: X, y Return value: averageWrite a function that implements the quadratic equation. Given three inputs (a, b, and c), calculate the roots (r1 (+) and r2 (-)) of the quadratic formula. Review 19 Write a function that implements the quadratic equation. Given three inputs (a, b, and c), calculate the roots (r1 and r2) of the quadratic formula. Call your function Roots a = 1 b = 2 c = -3 [r1,r2]=Roots(a,b,c)79. To find the decimal value of 1111, that is 15, we can use the function: a. int(1111,10) b. int(‘1111’,10) c. int(1111,2) d. int(‘1111’,2)
- Given a time in 24-hour notation, write a function that adds 2 times, a function that substracts 2 times, and a function that displays the time in 12-hour notation. (C++)Pyton.Write a function absolute(x) that prints the absolute value of xWrite a function with a single integer argument and return (not print) the sum of the last (rightmost) two digits of its argument. c++
- Write a function to convert the temperature in Fahrenheit to Celsius called FtoC and also a function to convert Celcius to Fahrenheit called CtoF C=5/9 (F-32) Compute the result of each for values of 0, 32, 50, 100 Verify that CtoF(FtoC (T)) == TWrite a C function that calculate the following formula ( R,n,S ( double ) are input V ( double) output and returning value of functionInput : (5,8 ) output: 5' 8" - I should define a function