Calculate the average of a variable quantity of integers

Assignment Help Programming Languages
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.

Reference no: EM13693809

Questions Cloud

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.

Reviews

Write a Review

Programming Languages Questions & Answers

  Prepare program to compute and display area of triangle

The area of any right triangle is equal to one-half of base times its height. Prepare the program which will compute and display area of a triangle which has a base of 4 and a height of 5.

  You have in your program an arraylist which contains

you have in your program an arraylist that contains employee salaries double type in arbitrary order. you need to

  Compute and display total number of votes received

Display the table with appropriate labels for the rows and columns. Compute and display the total number of votes received by each candidate and the percentage of the total votes cast.

  Program that will help user with metric conversions

Write a program that will help the user with metric conversions. Your program should allow the user to specify the names of the units as strings (e.g., centimeters, liters, grams, for the metric system and inches).

  Executive committee for alleviating it complexity

You are a consultant brought in by the executive committee to make recommendations for alleviating the "IT complexity" concerns of the executives at the company.

  Write a program that will operate the alarm simulation

Write a program that will operate the Alarm Simulation, using the following inputs and outputs and whatever Timers and Flags are required.

  Write a recursive method nmbdigits

Design and implement meanIter, the iterative version of the method - Write a recursive method nmbDigits which takes an integer value as parameter and returns the number of digits of the parameter value

  What professional organizations might you join and websites

a write a 200- to 300-word short-answer response to the followingwhat professional organizations might you join and

  Program to accept mass-density and compute volume

Write down the program which accepts as input the mass (in grames) and density (in grams per cubic centimeters), and output volume of the object.

  Show tic-tac-toe game scenario diagram

The assignment is not to implement this game in Ruby. Rather, the assignment is to use scenario diagrams to discover the objects, their responsibilities, and the messages they respond to

  Build a student record managing system application

Build a student record managing system application

  Write a bioperl-based script

Write a BioPerl-based script ("pick-by-id.pl") to extract sequences by id. It will emulate the "blastdbcmd -db -entry" command. Use "GBB.pep" and "BBA15" as the two arguments.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd