Question

In: Computer Science

Define a function named sumsinconv that accepts double precision variable theta, double precision variable alpha, and...

Define a function named sumsinconv that accepts double precision variable theta, double precision variable alpha, and unsigned integer n, and returns the solution of expression

sin ⁡ ( ( n + 1 ) α 2 ) sin ⁡ ( θ + n α 2 ) sin ⁡ ( α 2 )

in C

Only show the function definition. Do not write an entire program with a main function. Just write the definition for function sumsinconv.

Solutions

Expert Solution

C CODE( function sumsinconv)

float sumsinconv(double teta, double alpha,unsigned int n)
{
  
double sol=sin((n+1)*alpha*alpha)*(sin(teta+n*alpha*alpha))*sin(alpha*alpha);
// expression for sin ⁡ ( ( n + 1 ) α 2 ) sin ⁡ ( θ + n α 2 ) sin ⁡ ( α 2 )
return sol;
}

FULL CODE

#include<stdio.h>
#include <math.h>
float sumsinconv(double teta, double alpha,unsigned int n);
void main()
{
double teta;
double alpha;
unsigned int n;

printf("\nEnter the value of teta:"); //input the values
scanf("%lf",&teta);
printf("\nEnter the value of alpha:");
scanf("%lf",&alpha);
printf("\nEnter the value of n :");
scanf("%d",&n);
double r=sumsinconv(teta,alpha,n); //function call
printf("\n solution for expression :%lf",r); //display output
}


float sumsinconv(double teta, double alpha,unsigned int n)
{
  
double sol=sin((n+1)*alpha*alpha)*(sin(teta+n*alpha*alpha))*sin(alpha*alpha);
// expression for sin ⁡ ( ( n + 1 ) α 2 ) sin ⁡ ( θ + n α 2 ) sin ⁡ ( α 2 )
return sol;
}

I hope the answer is clear and satisfactory . If you have any doubts feel free to ask in the comment section. Please give a thumbs up.


Related Solutions

. Assume that a double variable named alpha contains the value of an angle in radians....
. Assume that a double variable named alpha contains the value of an angle in radians. Compose a C++ statement that will display the sine of the angle so that it occupies 12 positions on the screen and displays 3 digits after the decimal point.
C++ Please Define a function named "isAscending" that accepts a string as an input parameter and...
C++ Please Define a function named "isAscending" that accepts a string as an input parameter and returns "true" if all the characters included in the string are ordered in ascending order of their ASCII codes or the input string is a null string, and returns "false" otherwise. For example, if the string "ABXab" is passed to the function, it returns "true" because the ASCII code of 'B' is greater than 'A', 'X' is greater than 'B', 'a' is greater than...
Define a function in Javascript named secondHighest which accepts an array of numbers, and returns the...
Define a function in Javascript named secondHighest which accepts an array of numbers, and returns the second highest number from the array. If the highest value occurs more than once, then it is also the second highest (see example). Assume the input array will always have length at least two (so there is always a second highest value). The original array must NOT be modified by this function. Example secondHighest([5,3,8,6,2,7,4]) must return 7, and secondHighest([5,3,8,6,2,7,8]) must return 8. I have...
Declare and define a function named getCurrentHours_OR_Month that accepts one Boolean parameter. If the Boolean parameter...
Declare and define a function named getCurrentHours_OR_Month that accepts one Boolean parameter. If the Boolean parameter is true, the function returns current hours; if the Boolean parameter is false, the function returns current month. o This function will obtain the current system time and extract the hours or the month value from the system time depending on the Boolean being received. o This function will return the extracted value as an integer value. o Note that the system time displays...
Define a function named "find" that accepts two input parameters: "s "and "ch". "s" is an...
Define a function named "find" that accepts two input parameters: "s "and "ch". "s" is an object of the type "string" and "ch" is a character value with the default argument of 'A'. The function looks for the character "ch" in the string  "s" and displays all the indices of its occurrences on the screen. For example, if the caller sends the values of "ABCDBGAB" and 'B' to the function for the parameters "s" and "ch", respectively, the function displays the...
Write a function, named isMultipleOfFive that accepts integer argument. When the function is called, it should...
Write a function, named isMultipleOfFive that accepts integer argument. When the function is called, it should display if the argument "is a multiple of 5" or "is not a multiple of 5".
3. Write a function named "countNonAlpha" that accepts a string. It will return the number of...
3. Write a function named "countNonAlpha" that accepts a string. It will return the number of non-alphabet characters (excluding blanks) in the string. For example, if the string is "Hello, World!", it will return 2 for ',' and '!" in the string. 4. Write a function named "deleteZeros" that takes two arguments: a. an array of integer values; b. an integer for the number of elements in the array; The function will return the number of zeros that it has...
Create a method named stringOperations () that accepts a string variable. This method must perform the...
Create a method named stringOperations () that accepts a string variable. This method must perform the following operations:                Split the sentence into an array                Display each element in the array on a seprate line using “ForEach”                Print the first element in the array, using the array syntax                Tell the user where the second word starts                Display the first 3 characters of the second word In your man method, ask the user to enter a sentence...
Write a class named GasTank containing: An instance variable named amount of type double, initialized to...
Write a class named GasTank containing: An instance variable named amount of type double, initialized to 0. An instance variable named capacity of type double. A constructor that accepts a parameter of type double. The value of the parameter is used to initialize the value of capacity. A method named addGas that accepts a parameter of type double. The value of the amount instance variable is increased by the value of the parameter. However, if the value of amount is...
Define a class named Document that contains an instance variable of type String named text that...
Define a class named Document that contains an instance variable of type String named text that stores any textual content for the document. Create a method named toString that returns the text field and also include a method to set this value. Next, define a class for Email that is derived from Document and includes instance variables for the sender, recipient, and title of an email message. Implement appropriate set and get methods. The body of the email message should...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT