I have an assignment for CS programming.. its about linux system. C program.
I will attach the program details as a power point file.
The due date is 5hours from now
Here is a hint about what I want to do …
Here is some code that declares the variables needed for each line:
float line_a_x1,line_a_x2,line_a_y1,line_a_y2;
float line_b_x1,line_b_x2,line_b_y1,line_b_y2;
This code reads in data for one line from the keyboard (by default):
printf(“Enter the two x,y pairs for line A: “);
scanf(“%f %f %f %f”,&line_a_x1,&line_a_y1,&line_a_x2,&line_a_y2);
I want the work included these cases …
Case 1: Two normal sloped lines have different slopes. Intercepts
Case 2: Two normal sloped lines have same slope but different y-intercept. Doesn’t intercept
Case 3: One vertical line (slope = 0) and one normal sloped line. Intercepts.
Case 4: Two vertical lines (slope = 0) with different x-intercepts. These x-intercepts would be the same as their x-position as with all vertical lines
Case 5: Two normal sloped lines with same x-intercept, y-intercept, and slope. Intercepts
Case 6: Two vertical lines (slope = 0) with same x-position/intercepts
Case 7: One vertical line and one dot (Only one position for dot, both ordered pairs have same position for dot). Doesn’t intercept
Case 8: Two dots. Doesn’t intercept.
Look for:
Normal lines
Vertical Lines (Slope = 0, X stays the same)
Horizontal Lines (Undefined slope, Y stays the same)
Dots (Undefined Slope, X & Y stays the same)


0 comments