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

i have wrote a c program to solve the slope, y intercept, and equation of a line

ID: 3637384 • Letter: I

Question

i have wrote a c program to solve the slope, y intercept, and equation of a line. given two points.
i have all of this done and it works fine however i am then given a 3rd x coordinate of -5 and cant figure out how to write the program for it to print out the cooresponding y coordinate using y = mx + b

the points i am given are x1 = 2, y1= 3, x2 = 8, y2= -2
so i wrote the program and i get for the slope -0.833 the y intercept came out as 4.667 so the equation of the line came out as y = -0.833x + 4.667 i know algebraically that give the 3rd x coordinate you plug it in for x and solve and the coorespoding 3rd y coordinate would be 8.833. so i need help writing the last part of the program using printf to print out that coorespoding 3rd y coordinate.

Explanation / Answer

you should have posted your code but i think this is what your asking for float y; int x = 5; y = -0.833*x + 4.667; printf("The third Y coordinate is %f",y); %f means that the variable your outputting is a float %d is a integer. Y needs to be a float since its a decimal number