Question: C Programming Program on a Perpendicular Bisector -- Areas of concern are highlighted in yellow Problem: can't get my output to mirror the solution. My

C Programming

Program on a Perpendicular Bisector -- Areas of concern are highlighted in yellow

Problem: can't get my output to mirror the solution.

My output is in the form of y = -2.50x-8.25 , and should show y = -2.5x + 8.25......

this should be changed to + 8.25

Program is to output the following:

C Programming Program on a Perpendicular Bisector -- Areas of concern are

my output shows:

highlighted in yellow Problem: can't get my output to mirror the solution.

my code:

#include #include

int main() {

double x1, y1, x2, y2, xmid, ymid, per_bisect, b; double slope; // First Point printf("First Point "); printf("Enter x value: "); scanf ("%lf ", &x1); printf ("Enter y value: "); scanf ("%lf", &y1); printf(" "); // Second Point printf("Second Point "); printf ("Enter x value: "); scanf ("%lf", &x2); printf("Enter y value: "); scanf("%lf", &y2); printf(" ");

printf("The points entered are (%lf, %lf) and (%lf, %lf). ", x1,y1,x2,y2); //slope of line slope = (y2 - y1)/(x2 - x1); //mid point calculation

xmid = (x1 + x2)/ 2; ymid = (y1 + y2)/ 2; //slope of the perpendicular

per_bisect = -1/(slope); //Yintercept value is b b = ymid - (per_bisect * xmid);

printf("The equation of the perpendicular bisector is y = %2.2fx-%2.2f", per_bisect,b); return 0; }

Your program interface should be as follows: First Point Enter x value: 2.0 Enter y value: -4.0 second Point Enter x value: 7.0 Enter y value: -2.0 The points entered are (2.0, 4.0) and (7.0, -2.0 The equation of the perpendicular bisector is y --2.5x +8.25

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!