Question: Hi I need help working on this program. It needs to be done with a decrease and conquer algorithm and needs to run with no
Hi I need help working on this program. It needs to be done with a decrease and conquer algorithm and needs to run with no warnings.
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 solution must be a recursive, decrease
and
conquer 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
i
e
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
e
g
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.edu
e
g
jagraves
cpp
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:
g
Wall
pedantic
std
c
source 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.
$
a
out max
element
txt
$
a
out max
element
txt
$
a
out max
element
txt
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
