Question
This HW#5 there has to be 2 programs. this is HW#5 #include #include #include typedef struct record{ int t; float tp, tf, tt; } record;
This HW#5
there has to be 2 programs.
this is HW#5
#include
typedef struct record{ int t; float tp, tf, tt; } record;
void populateArray(record **arr, int size) { int i; for(i=0; i
void printChangeInPress(record **arr, int size) { int i = 0; for(i=0; i
int main() { srand(time(NULL)); record ** arr = (record **) malloc(21 * sizeof(record*));
populateArray(arr, 21);
printChangeInPress(arr, 21); }
1170%1 1 :23 PM KHw6-3223-Fa. : Homework Assignment #6 Course: COP 3223C-Intro to Programming with C Semester: Fall 2017 Credit Value: 4% of Final Grade Due Date: November 20, 2017 You changed your mind about how to output the results of your transmogrifier monitoring system. Instead of printing out the output to the screen, which is rather useless, you have brilliantly decided to write the results out to a file on the hard drive. That way, the results can be made part of the permanent record and can be easily shared among interested parties. The latter was hard to do when it merely printed the results out to screen. However, your boss said that she wants to see the output on his screen, but she happens to be a techno-retard and doesn't know how to handle files. Imagine that! So, you will write a second program (not another function to the old program, but rather a completely separate program) that reads the results from the file and prints the output to screen. You can assume a known name for the file and hardcode it in the second program so the user doesn't have to enter the name of the file to be written to or read. You can call it output-data.txt. So, take the program you wrote for HW #5 and modify it to do the following 1) The printout function should now print out to output-data.txt. Take out all code that prints to screen, but save it because you are going to use it for step 2 below. That's it for the Hww5 program-nothing else 2) Write a second program (i.e., NOT a function in the first program!) that reads the data from output-data.txt and prints it out to screen. You can do this in one of two ways a) print each row as it is read from the file; or preferably, b) populate an array in the printout function that holds the values read from the file and then print from this array to screen. The first is more efficient;the second is more elegant and organized Submission instructions Submit your program source code for each of the two programs as .c files through the Webcourses homework submission page o DO NOT email it to me or to the TAs! It won't count. o DO NOT submit the project file!!! o Do not submit output-data.txt. Your program 1 should be able to generate it. Please name the files as HW6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started