Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. (50 points) write a program that reads a minimum of three command line arguments and displays the program's results. Use functions to implement the

image text in transcribed
image text in transcribed
4. (50 points) write a program that reads a minimum of three command line arguments and displays the program's results. Use functions to implement the tasks outlined below. a. Command Line arguments: a i. The first argument will be the program name. a.ii. The second argument will be the function to be executed a iii. The third through ending arguments will be the appropriate data. a.iv. write a function to parse the command line data. b. Program will implement the following functions: b.i. A function that finds the largest of list of integer numbers in the command line b.ii. A function that finds the smallest of list of integer numbers in the command line b iii. A function that calculates the sum of integer numbers in the command line iv. A function that calculates the average of integer numbers in the command line. Return type should be an int, not floating point. (Your function should protect against a divide by zero error and display appropriate error messages. b.v. Your program will execute the function specified by the command line input. Treat these functions as command line options. On the command line, function names will be preceded by a or This means the user will type either two double dashes or a single dash followed by one of the following words: max, min, sum, average The command line option --max or-max means your program should call the max function and display the maximum value of all those integer values listed on the command line. The command line option --min or -min means your program should call the min function and display the minimum value of all those integer values listed on the command line. There is no space between the double dashes and the function name on the command line max

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_2

Step: 3

blur-text-image_3

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

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions

Question

6. What is process reengineering? Why is it relevant to training?

Answered: 1 week ago