Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:30, raytaylorh010801
Write a computer program to calculate the three-phase fault current for a fault at f in figure 1.16, with the network normal, and with one line at a time removedproblems 1.1 write a computer program to calculate the three-phase fault current for a fault at f in figure 1.16, with the network normal, and with one line at a time removed 20 power system relaying from service. the positive-sequence impedance data are given in the accompanying table. use the commonly made assumption that all prefault resistance values are (1.0+j0.0) pu, and neglect all resistance values. calculate the contribution to the fault flowing through the cb b and the voltage at that bus. for each calculated case, consider the two possibilities: cb b2 closed or open. the latter is known as the stub-end fault í• figure 1.16 problem 1.1 system data for figure 1.16 from to positive sequence 0.0+j0.1 0.05j0.15 0.04 j0.2 0.01 jo. i 0.015 + j0.15 0.01 j0.19 0.01 +j0.19 0.03+j0.1 0.0+j0.08 6 6 6 from service. the positive-sequence impedance data are given in the accompanying table. use the commonly made assumption that all prefault resistance values are (1.0 + j 0.0) pu, and neglect all resistance values. calculate the contribution to the fault flowing through the cb b1, and the voltage at that bus. for each calculated case, consider the two possibilities: cb b2 closed or open. the latter is known as the “stub-end” fault.
Answers: 2
image
Computers and Technology, 22.06.2019 18:40, penelopymorales24
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
image
Computers and Technology, 24.06.2019 07:20, djs1002
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience. ob. add presenter's notes to each slide. oc. add a video to each slide. od. save her slide presentation to a flash drive
Answers: 2
image
Computers and Technology, 24.06.2019 10:20, savyblue1724707
Identify the publisher in this citation: carter, alan. a guide to entrepreneurship. new york: river’2008.print.
Answers: 3
Do you know the correct answer?
Open the file named "1234-as4input. txt" for reading. Open the file named "1234-as4output-yourlastn...

Questions in other subjects:

Konu
Biology, 03.04.2020 02:28