Question: C C in visual studio 2019 Problem statement:Design a program which will: 1. Prompt for a pair of coordinate points 2. Calculate a slope and
Problem statement:Design a program which will: 1. Prompt for a pair of coordinate points 2. Calculate a slope and intercept, based upon the points entered 3. Display the equation f(x) = m x +b", where m and b are the values calculated in step 2 4. Allow the user to enter a value for x and display the corresponding value for f(x) 3. Provide a means to repeat step 4 until the user wishes to stop Example system model: f(x) (x, y) m = (y2 - y1)/(x2-x1) b-yl - m*x1 *Hand in: 1. A copy of your program (paper copy) 2. Sample hand example 3. Execution listing Sample run: equation on n form X1 Y1:2 2,4 X2 Y2:? 5,8 slope = 1.333333 b= 1.333333 f(x) = 1.333333 *x + 1.333333 v enter x: (-1 to quit)? 10 f( 10 )= 14.66667 enter x: (-1 to quit)? 12.34 f( 12.34) = 17.78667 enter x: (-1 to quit)? -1 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
