Question: I need some help trying to work on this program I've been stuck on . Here is the problem. The Maximum Element Problem The maximum
I need some help trying to work on this program I've been stuck on Here is the problem.
The Maximum Element Problem
The maximum element problem ask to find the maximum element in an array. This assignment will focus on a bruteforce solution to the maximum element problem.
Program Specifications
You will write a C program to find the maximum element in a list of numbers. For the
purpose of this assignment, you may assume that all of the elements are integers and can
be stored in an int type. Your implementation must be a bruteforce solution dont try to
get too fancy with your algorithm Your program will take in a command line argument
specifying a file name. The associated file will contain a collection of numbers separated by
whitespace you may assume new lines Your program must read in the numbers and print
the maximum value found followed by a new line.
Make sure to include basic error checking in your program ie command line arguments,
file exists, correct file format, etc. Do not hardcode any size limits on the collection of
numbers or use VLAs you may want to use a standard template library container to
store the elements eg std::vector Do not use the std::max element function in your
solution. See the end of this handout for example output.
Submission and Grading
Your source code should be contained in a single file and should be named after your TTU
email address excluding the @tntech.edueg jagravescpp All submissions will be
made on iLearn please do not zip or compress your files. Make sure to follow best coding
practices proper naming conventions, useful comments, functions, etc. Your program
should compile without errors or warnings. Programs will be compiled using the following
command:
gWall pedantic stdcsource file
Sample Output
The following lines contain sample input and expected output to your programs. Please note
that these examples are not exhaustive, and you should verify your programs with additional
test cases.
$ aout inputtxt
$ aout inputtxt
$ aout inputtxt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
