subject

Open the file named "1234-as4input. txt" for reading. Open the file named "1234-as4output-yourlastname-yourfi rstname. txt" for writing. For instance, my test implementation will open 1234-as4output-doe-john. txt.
Input

From the input file, read:
A title line of text.
Two ordered pairs (x1, y1) and (x2, y2) of floating-point numbers. Each pair will be on one line, separated by a comma, enclosed in parentheses. You'll need to use either fscanf(), or fgets() with sscanf(), to decode these pairs.
An integer count n.
A set of n floating-point numbers, one per line. n will be less than 50.
Computation
Treat the two ordered pairs as points, and determine the slope and intercept of the line they lie on.
Treat the number set read from the file as an array of x coordinates. Compute the y coordinate of the line for each x coordinate, and store the result in an array.
Output
To the output file, write:
The title.
The original ordered pairs, and the slope and intercept computed from them.
All five sets of results, with a descriptive line before each. Include the x coordinate and the computed y value. Line up the x and y coordinates on their decimal points.
The Catch
You don’t know how many x coordinates you have until you read the file.
You'll need to use arrays to store the coordinates, use pointers to pass the coordinates, and use array-length variables to tell the functions how many you have. Be careful!
Attacking the Problem
Don't try to attack this entire program all at once. You'll fail. You need to apply the divide-and-conquer approach to problem-solving. In this case, that means:
Deal with opening and reading the input file. After that, use ordinary printf()'s with ordinary for loops to convince yourself that you've captured all the input from the file.
Deal with the calculations. Write them one at a time. Use ordinary printf()s with ordinary for loops to test each one, making sure that you're getting the results correct.
Deal with opening and writing to the output file.
Your code must compile without errors or meaningful warnings, and run with any reasonable inputs. You must follow all coding conventions that we've established. Submit only the .c file here.
Notes
Use functions wisely.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 00:50, sequoyaburke
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
image
Computers and Technology, 24.06.2019 09:30, kyreesegordon
Retype the statements, correcting the syntax errors. system. out. println("num: " + songnum); system. out. println(int songnum); system. out. println(songnum " songs"); note: these activities may test code with different test values. this activity will perform two tests: the first with songnum = 5, the second with songnum = 9. see how to use zybooks.
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, heathersloan274
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 1
image
Computers and Technology, 24.06.2019 16:00, dareaalcaam111
What is a dashed line showing where a worksheet will be divided between pages when it prints? a freeze pane a split box a page break a print title
Answers: 1
You know the right answer?
Open the file named "1234-as4input. txt" for reading. Open the file named "1234-as4output-yourlastn...

Questions in other subjects: