Explanation of Solution
cos():
The C++ library function, “cos()” returns the cosine of an argument.
- To use the “cos()” function, the “cmath” header file is required
- The “cos()” function is useful in some of the scientific and other special-purpose programs.
- The argument and the return type of the “cos()” is double.
Example:
b = cos(a);
Explanation:
“b” is a variable which contains the result of a cosine of the argument where “a” is a argument.
log():
Log is an “inverse operation” to exponentiation.
- To use the “log()” function, the “cmath” header file is required.
- Log returns the “natural logarithm” of argument.
- The argument and the return type of the “log()” is double.
Example:
b = log(a);
Explanation:
“b” is a variable which contains the result of a natural logarithm of the argument where “a” is a argument.
sin():
The C++ library function, “sin()” returns the sine of an angle.
- To use the “sin()” function, the “cmath” header file is required.
- The “sin()” function is useful in some of the scientific and other special-purpose programs.
- The argument and the return type of the “sin()” is double.
Example:
b = sin(a);
Explanation:
“b” is a variable which contains the result of a sine of the argument where “a” is a argument.
exp():
The C++ library function, “exp()” returns exponential function of an argument.
- To use the “exp()” function, the “cmath” header file is required.
- The “exp()” function is useful in some of the scientific and other special-purpose programs.
- The argument and the return type of the “exp()” is double.
Example:
b = exp(a);
Explanation:
“b” is a variable which contains the result of an exponent of the argument where “a” is an argument.
log10():
Log is an “inverse operation” to exponentiation.
- To use the “log10()” function, the “cmath” header file is required.
- Log10 returns the “base -10 logarithm” of argument.
- The argument and the return type of the “log10()” is double.
Example:
b = log10(a);
Explanation:
“b” is a variable which contains the result of a base-10 logarithm of the argument where “a” is a argument...
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
- Which of the following is a complete function? (a) Int funct(); (b) Int funct(int x) {return x=x+1;}(c) Void funct(int) {printf(“Hello");} (d) Void funct(x) {printf(“Hello");}(e) None of the above.arrow_forwardWhat are the differences between the below two functions: def f1(x): print x + 1 def f2(x): return x + 1arrow_forward2-Determine the output of the following functions (You must show your works) c. (cdaaddaar '(((orange grape ((() apple () ()) banana))) apple banana)) Written explanation requiredarrow_forward
- Write a FUNCTION with one parameter, a float value called num, that will calculate half of num and return the result. The first line of the solution is provided. Be sure your code returns a value (using a return statement); do not print the result.arrow_forwardHello I need help this code is for MATLABthe following functions with all the given input and write comments that what the function does fix floor ceil int32 round roundn try all the above functions for 3.111 3.5 3.999 -3.111 -3.5 -3.999arrow_forwardWrite three functions, float getNum(), float add(float, float), void outSum(float); that asks user for two numbers, finds the sum of two numbers, and displays the sum repeatly in a main program until the user enter “0” for either one of the numbersarrow_forward
- Which of the following is a correct and complete function definition? a. double funct(double x) { return 2*x; } b. double funct(Int x) { return (x-3); } c. int funct (x) { return (++x); } d. int funct (int x); e. void funct(x=7) { return 8; } f. void funct(int x=7) { return x/3; }arrow_forwardQ1) Write a function that will take Bid and ask price in dollars, and a) return dollar bid-ask spread (name the function in_ dollar_bidask ) b) compute proportional bid-ask spread (name the function in_dollar_bidask ) c) Write test code to test a) and b)arrow_forwardAll functions A.) return true or false B.) receive a parameter C.) must be named differently D.) do something E.) none of the abovearrow_forward
- Python program that takes two values as user input, x and y; then applies the following equations on x and y and prints the output of the functions. ? = ? ∗ 10 − ? ∗ 3 ? = ???((2 − ?) ∗ ? + ?) Please note, you have you utilize functions to solve this problem. Make sure to use floating point numbers while calculating.arrow_forward1. Which among the following function can be called without arguments? a) void add(int x, int y=0) b) void add(int=0) c) void add(int x=0, int y=0) d) void add(char c)arrow_forwardWrite three functions, float getNum(), float add(float, float), void outSum(float); that asks user for two numbers, finds the sum of two numbers, and displays the sum repeatly in a main program until the user enter “0” for either one of the numbers. C++ language only.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education