1 answer

The program should be in C programming The law of sines is an equation relating the...

Question:

The program should be in C programming

The law of sines is an equation relating the lengths of the sides of an arbitrary triangle to the sines of its angles. Such t

The law of sines is an equation relating the lengths of the sides of an arbitrary triangle to the sines of its angles. Such that if we have the following triangle: sin a sin ß sin y A B C B Write a program that takes the values of angle a, angle B and length of A from a user. These input values are passed to a function find which calculates the angle y and the length of C. Remember that the total sum of all angles in the triangle is 180° (1.e. a + B+ y = 180°). The calculated angle y and the length of C should then be displayed on the screen. Note the following: Ensure that the values for a, ß and C taken from the user are always positive (unsigned) integers. Ensure that the sum of the of values for a, B taken from the user is less than 180° Remember that the sin(), cos() and tan() functions are available in the math.h file Be mindful of your choice of data types 1 1

Answers

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thank You.

code.c

#include<stdio.h>
#include<math.h>


void findC(float a,float b,float lenA){
   float angleC = 180-a-b;
   float radianChanger = 3.14/180;
   printf("The value of angle c is : %.2f\n",angleC);
   float lenC = sin(angleC*radianChanger)*lenA/sin(a*radianChanger);
   printf("The value of length c is : %.2f\n",lenC);
}

int main(){
   float angleA,angleB,angleC;
   float lengthA,lengthB,lengthC;
   printf("Enter value of angle a : ");
   scanf("%f",&angleA);

   printf("Enter value of angle b : ");
   scanf("%f",&angleB);


   printf("Enter value of length A : ");
   scanf("%f",&lengthA);

   if(angleA<0 || angleB<0 || lengthA<0){
       printf("Error!!! Please enter positive values for the parameters....");
   }else if(180<=(angleA+angleB)){
       printf("Error!!! Please enter valid angle values");
   }else{
       findC(angleA,angleB,lengthA);
   }


   return 0;
}

K:\WORKSPACE\c_language_workspace\C\ui.exe Enter value of angle a : -12 Enter value of angle b : 23 Enter value of length A :

K:\WORKSPACE\c_language_workspace\C\ui.exe Enter value of angle a : 100 Enter value of angle b : 200 Enter value of length A

K:\WORKSPACE\c_language_workspace\C\ui.exe Enter value of angle a : 20 Enter value of angle b : 30 Enter value of length A :

.

Similar Solved Questions

1 answer
1. An increase in the supply of labor, the variable factor of production, will cause a monopsonist's: a. marginal revenue product curve to shift up b. marginal revenue product curve to shift...
1. An increase in the supply of labor, the variable factor of production, will cause a monopsonist's: a. marginal revenue product curve to shift up b. marginal revenue product curve to shift down arginal factor cost curve to shift up marginal factor cost curve to shift down ARP e. both "a...
1 answer
1877 23101.8 pro and 230 x 1 2 x 20 cm 20m x 20 the 2...
1877 23101.8 pro and 230 x 1 2 x 20 cm 20m x 20 the 2 20 mm You are given the equations used to solve a problem 2.3 x 101 m/2 (1.60x10CE (1.57x10- ) Q (8.4610-c/N )(0.00) Part A Choose the correct realistic problem for which this is the correc t ions An electron is released from the negative place o...
1 answer
Describe the process of periodontal regeneration, including the type and origin of cells involved in the...
describe the process of periodontal regeneration, including the type and origin of cells involved in the regenerative process....
1 answer
According to the scale on a road map, 3 cm represents 45 kilometers. If two cities measure 10 cm apart on the map, how many kilometers apart are they?
According to the scale on a road map, 3 cm represents 45 kilometers. If two cities measure 10 cm apart on the map, how many kilometers apart are they?...
1 answer
Jones Co. manufactures a single product which sells for $60 each and whose variable costs are...
Jones Co. manufactures a single product which sells for $60 each and whose variable costs are $40 each. Fixed costs are $600,000 for the year. What is the break-even point in dollars? In units? 1....
1 answer
JS Inc. has an expected return of 13% and Beta = 1.2 DS Corp has an...
JS Inc. has an expected return of 13% and Beta = 1.2 DS Corp has an expected return of 1 1.55% and Beta of .9 the market's expected return is 12% and Rf= 4% 111 aAccording to CAPM, which stock is a better buy? b What is the alpha of each stock?...
1 answer
Caspian Sea Drinks is considering the production of a diet drink. The expansion of the plant...
Caspian Sea Drinks is considering the production of a diet drink. The expansion of the plant and the purchase of the equipment necessary to produce the diet drink will cost $23.00 million. The plant and equipment will be depreciated over 10 years to a book value of $2.00 million, and sold for that a...
1 answer
Alternate Homework 13 14 ANOVA Problems 2 A nuclear reactor experiences a radiation leak. The following...
Alternate Homework 13 14 ANOVA Problems 2 A nuclear reactor experiences a radiation leak. The following data is measurements of radiation at three locations near the reactor. Perform a hypothesis test at 95% confidence to determine if the population mean radiation levels (for the three locations) co...
1 answer
Make sense out of what you see, a very useful trick is to use the stars...
make sense out of what you see, a very useful trick is to use the stars in some easily recognized constellations as pointers to other objects Polaris Here, the pointer stars in the Big Dipper are used to locate Polaris, a star very close to the North Celestial Pole. Here, the three stars of Orion...
1 answer
How do you solve #8/(x-4) -3=1/(x-10)#?
How do you solve #8/(x-4) -3=1/(x-10)#?...
1 answer
5. Cellulose is one of the most abundant organic molecules in the biosphere, but most animals...
5. Cellulose is one of the most abundant organic molecules in the biosphere, but most animals lack the enzymes needed to break it down. Nevertheless, some animals have and can digest a diet high in cellulose because a) cellulose provides essential fatty acids. b) cellulose provides essential amino a...
1 answer
Urn A contains seven white balls and four black balls. Urn B contains six white balls...
Urn A contains seven white balls and four black balls. Urn B contains six white balls and three black balls. A ball is drawn from Urn A and then transferred to Urn B. A ball is then drawn from Urn B. What is the probability that the transferred ball was black given that the second ball drawn was bla...
1 answer
Matlab need it in keyboard types not handwriting 2) The Pythagorean theorem states that a2+b2-c2 ....
Matlab need it in keyboard types not handwriting 2) The Pythagorean theorem states that a2+b2-c2 . Write a MATLAB pro- gram in a script file that finds all the combinations of triples a, b, and c that are positive integers all smaller or equal to 50 that satisfy the Pythagorean the- orem. Display...
1 answer
How long should a closed tube in air be such that it's fundamental frequency is 250Hz?...
how long should a closed tube in air be such that it's fundamental frequency is 250Hz? use V=343m/sec (B) what is the frequency of its next possible mode ?...