Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C only, only use basic cs1050 coding because the compiler is very strick. Dont use anything fancy, plain and simple, also make sure

Code in C only, only use basic cs1050 coding because the compiler is very strick. Dont use anything fancy, plain and simple, also make sure you do not use arrays. Start with an integer pointer and use malloc to allocate only the required anount of memory USE POINTER NOTATION AND POINTER ARITHMETIC only to implement the assignment.
image text in transcribed
image text in transcribed
This is output1.txt
image text in transcribed
This is output2.txt
image text in transcribed
Directions: Complete the following lab assignment using the description given in each section. Purpose: 1. Use command line arguments to do the assignment. 2. Use pointers and pointer notationarithmetic in implementation only. 3. Use functions from relevant libraries for the lab. Description The lab 11 is on malloc, command line and file processing. Download theinputi.txt and input2.txt from blackboard. Implement the following functions for the lab assignment. int loadNumbers (char int ,in): This function takes the input file name, the integer pointer to the array and the count of numbers. It opens the input file, if unable to open it returns 0 otherwise it loads the numbers from the file to the integer pointer and returns 1 at the end. void printNumbersoint ,int): This function prints the content of the array on to the screen, takes in the integer pointer and the size of the array float findAverage(int int): Takes in the integer pointer and find the average of all the numbers and returns it. int findMax(int ,int): Takes in the integer pointer and the size and finds the maximum number in the array. int findMin(int int): Takes in the integer pointer and the size and finds the maximum number in the array. int writeData(char *,int ,int): Takes the output filename, integer pointer denoting the integers, and the size of the array. Open the output file in this function, write all the information which is on the screen also to the output file and return 1 at the end. If unable to open return 0 and exit out of the code. Call this function twice, once for each input file and each set of values. Refer the sample output.txt posted on blackboard. int main0: Use command line arguments to read the file names and the length of records. Call

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Solve all 4 please!

Answered: 1 week ago

Question

Know the three main dimensions of the service environment.

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago