Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need a code for problem no. 5.. language should be same like question no. 4....

ID: 3871505 • Letter: N

Question


need a code for problem no. 5..
language should be same like question no. 4....

4. The below program outlines the requirements for obtaining state medical insurance in a country Analyse, comment each lne, and execute the program for various cases and present the output. (ASCII CODES FOR U' is 21 and 'M' is 13) Listing 6: Question 4 #include # includemath.h> # include ainO int sex, mart sta; int age, taxes, pre ext printf ( ENTER SEX and MARITAL STATUS ) scanf", s ("XdZd", &sex;, &mart-sta;); printf ( AGE Taxs PAID or NOT ANY PRE EXISTING CONDITIONS and AGENa") scarf-s(-%d%d%d", &age;, &taxes;, &pre-ext;); if ((mart-sta == ,M") 11 (mart-sta-,U, && sex == 'N'&& age > 25 && taxes 1) il (mart-sta-,U, && sex == ,F, && age > 30 && taxes-1) 11 (pre-ext printf("GRANT INSURANCEa) else printf("REFER TO REGIONAL OFFICE: REQUEST FOR FURTHER INFORMATIONN 5. The formula for the area of any triangle is: Area = V/s(s-a)(s-b) (s-c) x + b + c where s= Given the sides a, b, and c of a triangle determine whether it is a right triangle. Print the sides and the area. A triangle is right triangle if e2 a2 b2 where c is the longest side

Explanation / Answer

Q4)

main()
{
//declare the variables for sex and marital status
int sex, mart_sta;
//declare the variable for age,tax,pre_ext
int age, taxes, pre_ext;
//display message to accept sex and marital status
printf("Enter SEX and MARITAL status ");
//accept the sex and marital status
scanf("%d%d", &sex, &mart_sta);
//display message to accept tax, age, condition
printf("AGE Taxes PAID or NOT ANY PRE EXISTING CONDITIONS and AGE ");
//accept message to accept tax, age, condition
scanf("%d%d%d", &age, &taxes, &pre_ext);
{
/* to check marital status = m or marital status is unmarried and sex male and age >25 and tax=1
* or marital status is unmarried and sex female and age >>30 and tax=1 or pre_ext = then
* GRANT INSURANCE
* else
* REFER TO REGIONAL OFFICE: REQUEST FOR FURTHER INFORMATION
*/
if ((mart_sta == 'M') || (mart_sta == 'U' && sex == 'M' && age > 25 && taxes == 1) || (mart_sta == 'U' && sex == 'F' && age > 30 && taxes == 1) || (pre_ext == 1)) {
printf("GRANT INSURANCE ");
} else
printf("REFER TO REGIONAL OFFICE: REQUEST FOR FURTHER INFORMATION");
  
}
}

Q 5)

#include <stdio.h>
#include <stdlib.h>
# include <math.h>
main() {
float a,b,c; //sides of the triangle
float area,s; // to calculate the area and side
  
//accepts from the user, three sides of a triangle
printf(" Enter the value for A : ");
scanf("%f",&a);
printf(" Enter the value for B : ");
scanf("%f",&b);
printf(" Enter the value for C : ");
scanf("%f",&c);
  
//area calculation
s = (a+b+c) /2;
area = sqrt(s*(s-a)*(s-b)*(s-c));
  
//displays the result
printf(" The sides of the triangle is : %f",s);
printf(" The Area of the triangle is :%f",area);
// checks for the right angled triangle
if(c==(sqrt(a*a)+(b*b)))
printf(" It's a right angled triangle.");
else
printf(" It's not a right angled triangle.");
}