Question: 1. Write a Fortran program to read information from the user for two lines (slope m, and r and y values for a point on





1. Write a Fortran program to read information from the user for two lines (slope m, and r and y values for a point on the line), and output: the slope-intercept equation of each line y- y = m(2 - xy), where (11, y) is a point on the line); the point-slope equation of each line y=mx+b, where b is the y-intercept; a statement to indicate if the lines are parallel or perpendicular; the intersection point of the two lines if they intersect. Your program should include a derived data type representing a line and containing attributes for m, 2, and y, and you should use an array of this type to store the information provided by the user. See Sample input/output cases below for output format. Sample input/output 1: Enter the slope for the line 1.5 Enter a point on the line 1 2 Point-slope equation: y- 2.00= 1.50(x- 1.00) Slope-intercept equation: y= 1.50x+ 0.50 Enter the slope for the line 2.2 Enter a point on the line 4 2 Point-slope equation: y- 2.00= 2.20(x- 4.00) Slope-intercept equation: y= 2.20x+-6.80 The lines intersect Intersection point: (10.43,16.14) Sample input/output 2: Enter the slope for the line 1.5 Enter a point on the line 12 Point-slope equation: y- 2.00= 1.50(x- 1.00) Slope-intercept equation: y= 1.50x+ 0.50 Enter the slope for the line 1.5 Enter a point on the line 54 Point-slope equation: y- 4.00= 1.50(x- 5.00) Slope-intercept equation: y= 1.50x+-3.50 Lines are parallel Sample input/output 3: Enter the slope for the line 2 Enter a point on the line 24 Point-slope equation: y- 4.00= 2.00(x-2.00) Slope-intercept equation: y= 2.00x+ 0.00 Enter the slope for the line -0.5 Enter a point on the line 62 Point-slope equation: y- 2.00=-0.50(x- 6.00) Slope-intercept equation: y=-0.50x+ 5.00 The lines intersect Lines are perpendicular Intersection point: ( 2.00, 4.00)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
