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

Add one or more parentheses to expression so it evaluates to True. Explain what

ID: 669625 • Letter: A

Question

Add one or more parentheses to expression so it evaluates to True. Explain what order the operators were evaluated. a) 1 < -1 == 3 > 4

b) 2 + 3 == 4 + 5 == 7

C)in interactive mode, calculate the number of minutes in a week. Then repeat the exercise, and this time, make variables for days per week, hours per day and minutes per hour (feel free to make up your own names using proper naming conventions for variables). Assign appropriate values to the variables and use to calculate the number of minutes in a week.

D)Given trig formula for a triangle sin(angle) = opposite side of angle / hypotenuse Write a python expression involving hypotenuse and angle that computes the opposite side of the angle when hypotenuse = 16 and angle = 75 degrees. You will need to rearrange terms to solve for opposite side of angle. The math module sin() function takes its input in radians. You will need to convert the angle given in degrees to the angle in radians using: radians = * degrees 180

Explanation / Answer

a)

the order will be

(1 < -1) == (3 > 4

small c code for the same

#include<stdio.h>
int main()
{
   int a;
   a = (1 < -1) == (3 > 4);
   printf("%d",a);
}

Here 3>4 which is false or 0 and -1>1 which is also false or 0.

Now 0==0 so a = 1.

b)

2 + (3 == 4) + (5 == 7)

Here 3==4 will return false and 5==7 will also return false

adding 2 will make it one.

small c code

#include<stdio.h>
int main()
{
   bool a;
   a = 2 + (3 == 4) + (5 == 7);
   printf("%d",a);
}

c)

working c code

#include<stdio.h>
int main()
{
   int week,min;

  
   min=7*24*60;
   printf("number of minutes will be %d ",min);  
}

second part

working c code

#include<stdio.h>
int main()
{
   int week,min;
   int daysperweek = 7;
   int hoursperday = 24;
   int minutesperhour = 60;
   min=daysperweek*hoursperday*minutesperhour;
   printf("number of minutes will be %d ",min);  
}

d)

working python code

# your code goes here
import math;

angle=(75*3.14/180)
length = 16 * math.sin(angle);
print length

compiled on ideone

http://ideone.com/Bcs5Uq

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote