Reference no: EM13693809
Question: Create a simple command line program to calculate the average of a variable quantity of integers that are passed as an argument when the program is called. This uses the argv array from main - you should not use "scanf" or "cin" functions to complete this project.
When the program is launched, have it display a welcome message.
Also make sure to have the program display a help message if the user forgets to give any integers as the argument.
The below examples show the program on a Windows system.
If you use a Mac or Linux your program very likely will not have the ".exe" extension which is fine.
Example of calling the program with arguments:
average.exe 1 2 3 4 5 6
The result of the above should be something similar to:
Welcome to the Average Program. It is very average really.
The average is: 3.5
Example of calling the program without arguments:
average.exe
The result might be:
Welcome to the Average Program. It is very average really.
Usage: average X (X is 1 or more integers)
I'm not sure how to solve the program. Can anyone help me? Provide the code.
Economists occasionally speak of helicopter money
: Economists occasionally speak of “helicopter money” as a short-hand approach to explaining increases in the money supply. Suppose the Governor of the Fed flies over the country in a helicopter dropping 10,000,000 in newly printed $100 bills (a total ..
|
Generate a salary as a number with two digits
: Generate a salary as a number with two digits after the decimal point. The salary for a teacher should be in the range from $40,000 to 70,000.
|
Program to tests whether they form a magic square
: Write a program that reads n2 numbers from standard input and tests whether they form a magic square when put into matrix form.
|
Write a program to print out a simplified bill
: Write a program to print out a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered in response to INPUT statements.
|
Calculate the average of a variable quantity of integers
: Create a simple command line program to calculate the average of a variable quantity of integers that are passed as an argument when the program is called.
|
Write a program to print all of the permutations
: Write a program to print all of the permutations of the values 1, 2, 3, ..., n - Your program takes one argument from the command line, which as an integer n that is the number of elements.
|
What rules of inference are used in the argument
: What rules of inference are used in the argument? "No man is an island. Manhattan is an island. Therefore, Manhattan is not a man."
|
Rules of inference to show that the hypotheses
: Use rules of inference to show that the hypotheses "if it does not rain or if it is not foggy, then the sailing race will be held and the life saving demonstration will go on,"
|
Find the negation of each of statements
: Use de Morgans law to find the negation of each of the subsequent statements - kwame will take a job in industry or go to graduate school.
|